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 unkn...

- 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
- Permalink
- Email to a Friend
- Report Inappropriate Content

Mar 16, 2012 9:26 AM
(2024 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
- Permalink
- Email to a Friend
- Report Inappropriate Content

Mar 16, 2012 9:33 AM
(3888 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
- Permalink
- Email to a Friend
- Report Inappropriate Content

Mar 16, 2012 9:33 AM
(3889 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
- Permalink
- Email to a Friend
- Report Inappropriate Content

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