Re: subset selection is empty, return errorThere are many different options You can check if selection is empty/no rows are found and then either use stop() or throw() to stop script execution (if it is suitable).
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
dt << Select Where(:age == 100);
// you can check for selections in dt table
If(N Items(dt << get selected rows) == 0,
Show("No selections done");
);
dt_subset = dt << Subset(Selected Rows(1));
// you can check for dt_subset
If(Is Empty(dt_subset),
Show("No subset table");
);
rows_to_subset = dt << Get Rows Where(:age == 100);
If(N Items(rows_to_subset) == 0,
Show("No rows found");
);
// dt_subset = dt << Subset(rows(rows_to_subset));Re: subset selection is empty, return errorHi Jarmo,
thank you for your reply. I had finally time to check this and I see that the following solution worked:
dt_subset = dt << Subset(Selected Rows(1));
// you can check for dt_subset
If(Is Empty(dt_subset),
Show("No subset table");
);The other two still returned errors:

So I will use the second suggestion.
Best Regards, Valeria
subset selection is empty, return errorHi all,
I am writing a script where I select a subset from a data table based on some criteria:
Example dt is my data table with column :Error_ID
I input: "dt_subset=dt<
Now let us say the dt data table has no Error_ID==0 rows, the dt_subset is empty.
I would have expected an dt_subset to be a new data table with the same columns as table dt but 0 rows, so that if I then check whether "If( !Empty(dt_subset)...)" I get a false and I do not continue doing work on the empty dt_subset table.
Instead I get an error if I try to check the if dt_subset is empty.
Basically what I want to do is be able to check if the selection is empty. Do you have a solution?
Thank you for your help!
Quality and Process Engineering