Ian, thanks. This doesn't quite work as:
a) I need to refer to the number of selected rows (rather than total rows that I understand NRow works on) - because dt2 summarizes the total number of rows for all tags, not just those < 25.
b) If referring to selected rows in dt2, I think this needs to be > 0 rather than > 24 - because dt2 summarizes the total number of rows for all tags, so I am interested in all selected rows (even if there is only one; that one would be summarizing a tag appearing on fewer than 25 rows in the underlying dt).
Any other suggestions would be much appreciated. Thank you.
Ian@JMP wrote:
You need to use the 'NRow()' function in combination with an 'If()' expression. Something like:
Open( "data.jmp" );
dt = current data table() << Summary( Group( :tag ) );
dt2 = Data Table( "data By (tag)" ) << Select Where( :N Rows < 25) << Sort( By( :N Rows ), Order( Ascending ), Output Table Name("summary_of_small_n"));
if(
NRow(dt2 > 24,
// If the condition is satisfied, do this . . .
Data Table( "data" ) << Subset(( Selected Rows ), Output Table Name("sub_small_n"));
Data Table( "sub_small_n" ) << save("sub_small_n.jmp");
Data Table( "summary_of_small_n" ) << save("summary_of_small_n.jmp")
,
// Else do this . . .
Data Table( "data" ) << delete rows << save("data_less_small_n.jmp");
);