cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • DownloadSemiconductor Toolkit: Tools to create wafer maps, add wafer geometry to graphics, explore die defects & compare wafers.
  • Discovery Summit 2026: Early User Edition - September 23-24.Register. It's free.
  • See how to design an experiment, explore factor-response relationships, assess tradeoffs, and ID best settings. Register for Sep. 11 Mastering JMP.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
peter_t
Level II

How do I get rows based on dynamic column selection in JSL

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?

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How do I get rows based on dynamic column selection in JSL

Issue is with your colname

 

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

colname = Column(dt, "sex");
target = "M";
r2 = dt << Get Rows Where(As Column(colname) == target);
Show(r2);

or in my opinion better option

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

colname = "sex";
target = "M";

r2 = dt << Get Rows Where(As Column(dt, colname) == target);
Show(r2);

or

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

colname = "sex";
target = "M";

r2 = dt << Get Rows Where(Column(dt, colname)[Row()] == target);
Show(r2);

 

-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: How do I get rows based on dynamic column selection in JSL

Issue is with your colname

 

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

colname = Column(dt, "sex");
target = "M";
r2 = dt << Get Rows Where(As Column(colname) == target);
Show(r2);

or in my opinion better option

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

colname = "sex";
target = "M";

r2 = dt << Get Rows Where(As Column(dt, colname) == target);
Show(r2);

or

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

colname = "sex";
target = "M";

r2 = dt << Get Rows Where(Column(dt, colname)[Row()] == target);
Show(r2);

 

-Jarmo

Recommended Articles