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
- :
- Discussions
- :
- Set Values for cells where number of cells is unknown.

Topic Options

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

Highlighted

- 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
(3954 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} );

Solved Go to Solution

1 ACCEPTED SOLUTION

Accepted Solutions

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

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 2

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

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

Set Values for cells where number of cells is unknown.

Perfect. Thanks!