turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Set Values for cells where number of cells is unkn...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Mar 16, 2012 9:26 AM
(1470 views)

Hi,

What is the easiest way to set values for cells, where the number of cells is unknown. For example, in the following script, it is possible to set all cells where :age==12 to :age==0, and the number of cells where :age==12 is unknown?

dt = Open( "$SAMPLE_DATA/Big Class.JMP" );

dt << Select Where( :age == 12 );

:age << Set Selected;

Column( "age" ) << Set Values( {0} );

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Mar 16, 2012 9:33 AM
(2780 views)

Solution

This is one way to do it

dt = Open**(** "$SAMPLE_DATA/Big Class.JMP" **)**;

dt << Select Where**(** :age == **12** **)**;

:age**[**dt << Get Selected Rows**]** = **0**;

//Or even simpler

dt = Open**(** "$SAMPLE_DATA/Big Class.JMP" **)**;

:age**[**dt << get rows Where**(** :age == **12** **)]** = **0**;

2 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Mar 16, 2012 9:33 AM
(2781 views)

This is one way to do it

dt = Open**(** "$SAMPLE_DATA/Big Class.JMP" **)**;

dt << Select Where**(** :age == **12** **)**;

:age**[**dt << Get Selected Rows**]** = **0**;

//Or even simpler

dt = Open**(** "$SAMPLE_DATA/Big Class.JMP" **)**;

:age**[**dt << get rows Where**(** :age == **12** **)]** = **0**;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Mar 16, 2012 9:50 AM
(1390 views)