Selecting rows with specific dataHi 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
Automation and ScriptingRe: Selecting rows with specific dataYou 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));