Choose Language Hide Translation Bar
robot
Community Trekker

Set Values for cells where number of cells is unknown.

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

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
ms
Super User ms
Super User

Re: Set Values for cells where number of cells is unknown.

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;



View solution in original post

0 Kudos
2 REPLIES 2
ms
Super User ms
Super User

Re: Set Values for cells where number of cells is unknown.

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;



View solution in original post

0 Kudos
robot
Community Trekker

Set Values for cells where number of cells is unknown.

Perfect.  Thanks!

0 Kudos