cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

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

How to select rows based on multiple criteria?

Hi,

I am writing a script to Subset a data table. Following the scripting guids' coding example I can select according to a criterium:

for each row(Selected(Rowstate())=(name=="KATIE"));

How can I generalize this to select both KATIE and LOUISE?

This does not work:

for each row(Selected(Rowstate())=(name=="KATIE","LOUISE"));

So what is the syntax for this?

Regards

Poul

   

10 REPLIES 10
pmroz
Super User

Re: How to select rows based on multiple criteria?

This syntax might be a little more readable.  You can use the vertical bar for OR, and the ampersand for AND:

dt = open("$sample_data\Big Class.jmp");

dt << select where((contains(:name, "ATIE") | contains(:name, "OBER"))

                                      & contains(:sex, "F"));

Recommended Articles