cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

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

Selecting rows with specific data

Hi all,

Is it possible to select something specific in rows? How can it be done? I tried creating a list and incorporate it in Select Rows () but doesn't work. 

 

For example, in column Make, I want to select all the rows with BMW, Hyundai and Nissan.

dt = Open( "$SAMPLE_DATA/Cars.jmp" );

 

What I tried:

rows = {"BMW", "Hyundai", "Nissan"};

dt << Select Rows (rows);

 

It doesn't work. Please help

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Selecting rows with specific data

You can first use << get rows where to get list of interesting rows and then << Select Rows with that list. Or you could use << Select Where directly. Contains() is one option to perform the comparison during selection

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Cars.jmp");

models_to_find = {"BMW", "Hyundai", "Nissan"};

// option1
rows_to_select = dt << get rows where(Contains(models_to_find, :Make));
dt << Select Rows(rows_to_select);

// demo purposes
dt << clear select; // for demo purposes
wait(1);

// option 2
dt << Select Where(Contains(models_to_find, :Make));
-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: Selecting rows with specific data

You can first use << get rows where to get list of interesting rows and then << Select Rows with that list. Or you could use << Select Where directly. Contains() is one option to perform the comparison during selection

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Cars.jmp");

models_to_find = {"BMW", "Hyundai", "Nissan"};

// option1
rows_to_select = dt << get rows where(Contains(models_to_find, :Make));
dt << Select Rows(rows_to_select);

// demo purposes
dt << clear select; // for demo purposes
wait(1);

// option 2
dt << Select Where(Contains(models_to_find, :Make));
-Jarmo

Recommended Articles