Here is one example of a Transpose script that examines the data from the data table and generates a transposed data table based upon the data;
Names Default To Here( 1 );
theTranspose = Expr(
dt = Current Data Table();
// Get the first character column to use as the Label
theLabel = (dt << get column names( string, character ))[1];
// Get the numeric columns. All numeric columns will be transposed
theTransColumns = dt << get column names( string, numeric );
// Transpose the data
dt << Transpose( columns( theTransColumns ), Label( As Column( theLabel ) ) );
);
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );
theTranspose;
// Open Data Table: Blood Pressure.jmp
// → Data Table( "Blood Pressure" )
Open( "$SAMPLE_DATA/Cities.jmp" );
theTranspose;
I am sure this does not solve your specific problem, however, not knowing what your rules for how you want to transpose were not specified, I set the rules to be that all numeric columns found will be transposed, and that the first character column found would contain the new column names.
Jim