Script command to check whether a selection criteria returns >0 selected rowsI'm looking for a scripting command that checks whether a selection contains >0 selected rows. The issue: subsetting a table of selected rows when none are selected, stops the script and returns an error message. I circumvent this problem by creating a column that sets selected rows to 1, then take col sum and run the if command (if col sum > 0, subset, don't subset). But that's clunky and for loops with sometimes >1mio repeats, adds significant time to the process. Are there more elegant solutions? For example, the number of selected rows appears in the data table (row module, usually in left bottom corner), meaning JMP does count the selected rows internally, somewhere. Is there a way to retrieve this number in the script?
Automation and ScriptingRe: Script command to check whether a selection criteria returns >0 selected rowsdoesn't look like a "solution"

Re: Script command to check whether a selection criteria returns >0 selected rowsYeah I did paste incorrect code, it was supposed to be wrapped in N Items() (N Rows and N Cols should also work, but N Items is the most clear)
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
dt << select rows(1::10);
If(N Items(dt << get selected rows) < 1,
Show("stop1");
stop();
);
show("continue1");
dt << clear select;
If(N Items(dt << get selected rows) < 1,
Show("stop2");
stop();
);
show("continue2");
Re: Script command to check whether a selection criteria returns >0 selected rowsNot quite, because "get selected rows" returns a list, not the number of selected rows. Still good idea! I get selected rows as list and can query the number of items in the list. Thanks!
Re: Script command to check whether a selection criteria returns >0 selected rowsYou can use << Get Selected Rows and check the amount if items in the amtrix
If(dt << get selected rows < 1,
stop();
);