- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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"));
- « Previous
-
- 1
- 2
- Next »