该帮助的版本不再更新,请参见https://www.jmp.com/support/help/zh-cn/15.2 获取最新的版本.


Subset() creates a new data table from rows that you specify. If you specify no rows, Subset uses the selected rows. If no rows are selected or specified, it uses all rows. If no columns are selected or specified, it uses all columns. And if Subset has no arguments, the Subset window appears.
For example, using Big Class.jmp, to select the columns for all rows in which the age is 12:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
For Each Row( Selected( Row State() ) = (:age == 12) );
subdt = dt << Subset( Output Table Name( "Subset" ) );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Output Table Name( "Big Class 2" )
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Rows( [2, 4, 6, 8] ),
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Where( :age == 12 );
dt << Subset( ( Selected Rows ), Output Table Name( "Subset" ) );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Where( :age == 12 );
If( N Rows( dt << Get Selected Rows ) == 0,
newdt = Open( "$SAMPLE_DATA/Fitness.jmp" ),
newdt = dt << Subset( All Columns( 1 ), Selected Rows( 1 ) )