Here is an example of creating a subset of a table that has been specified by the settings in a Data Filter, and the name of the new table is the Where Clause used to create the table. It creates the upon closing of the Data Filter if there have been selections in the filter.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
nw = New Window( "Select Parameters",
//<<modal,
<<return result,
obj = dt << Data Filter(
//Location( {3000, -600} ),
Width( 315 ),
Conditional,
Add Filter(
columns( :age, :sex ),
Display( :Col2, "Check Box Display" ),
Display( :Col3, "Check Box Display" ),
Display( :Parameter, N Items( 20 ), "Check Box Display", Find( Set Text( "" ) ) )
)
)
);
nw << on close(
theClause = obj << Get Where Clause;
If( theClause != "",
dt << subset(
selected columns( 1 ),
selected rows( 1 ),
output table( Substr( theClause, 14, Length( theClause ) - 15 ) )
)
);
);
Jim