In a JMP script I would like to retrieve the rows matching a certain criteria specified by user. I would like to do something similar to this:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
r = dt << Get Rows Where( :sex == "M" );
Show( r );
Only where the criteria is selected by the user, i.e. the column ("sex") and the target value ("M") should be dynamic. I have tried this without luck:
colname=Column(dt,"sex");
target="M";
r2 = dt << Get Rows Where( colname == target );
show(r2);
What am I doing wrong?