Select rows that match any value in a list
Problem
Suppose you prompt a user to make a selection. When you retrieve the values from the user, typically they are stored in a list. Now you need to select the data that matches the values in the list.
Solution
The following example demonstrates how you can select rows in a data table that contain any value stored in a JSL list. Lists containing either numeric values or character strings can be used and are shown below. See the embedded comments for details.
/* Open a sample data table. */
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
/* Create a list of ages. */
myList = {9, 12, 15, 17, 18};
/* Select all rows which have an age that is in the list. */
dt << Select Where( Contains( myList, :age ) );
Wait( 2 ); // For demonstration purposes
/* Create a list of student names. */
myStudents = {"HENRY", "ROBERT", "BARBARA", "SALLY", "MARION"};
/* Select all rows which have any of the names in the list. */
dt << Select Where( Contains( myStudents, :name ) );
Re: Select rows that match any value in a listAh, nice 
I feared that contains is slower. but actually ...
note to myself: use contains 

View more...
Re: Select rows that match any value in a listIs there some specific need to use more complex syntax? You could use Loc with Any
Names Default To Here(1);
dt = Open("$SAMPLE_DATA\Big Class.jmp");
dt << Select Where(Any(Loc({"JANE", "DAVID", "PATTY"}, :name)));
Re: Select rows that match any value in a listsame result, yes.
but different syntax.
Re: Select rows that match any value in a listIsn't that what you would use Contains() for?
Re: Select rows that match any value in a listdt << Select Where( Any( Row() == Index( 3, 5 ) ) );
is cool 
is there something similar for
dt << Select Where( Any( :name == {"JANE", "DAVID","PATTY"}) );?