BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar

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

1 ACCEPTED SOLUTION

Accepted Solutions

## 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;

2 REPLIES 2

## 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;

Highlighted

## Set Values for cells where number of cells is unknown.

Perfect.  Thanks!