Split() breaks a stacked column into several columns.
dt << Split(
Split( columns ),
// the column to split (required)
Split by( column ),
// the column to split by (required)
Group(column),
// split data within groups
<Private>|<Invisible>,
// resulting table is private or invisible
Remaining Columns( Keep All | Drop All | Select( columns ) ),
/* specify what to do with the remaining columns in the resulting table (Keep All by default) */
<Copy formula( 0|1 )>,
/* include column formulas from the source table in the resulting table (default is 1, true) */
<Suppress formula evaluation( 0|1 )>,
// stop any copied formulas from being evaluated (default is 1, true)
Sort by Column Property( "Value Ordering" {"string", "string"} | "Row Order Levels" ),
/* sorts the order of resulting columns by the specified
property (must be specified on the Split by column) */
Output Table( "name" ));
// generate the output to the table name specified
The following example reverses the previous example for Stack(), returning essentially the original table, except that the height and weight columns now appear in alphabetic order:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Stack(
Columns( :weight, :height ),
Source Label Column( "ID" ),
Stacked Data Column( "Y" ),
Name( "Non-stacked columns" )( Keep( :age, :sex ) ),
Output Table( "Stacked Table" )
);
dt2 = Data Table( "Stacked Table" );
dt2 << Split(
Split( Y ),
Split by( ID ),
Output Table( "Split" ) );