I personally try to avoid any auto-scoping in JSL, especially when it comes to column names. If you explicitly scope :TOTAL
to DT:TOTAL
then this works. The reason for the failure is because dt
is not the current data table, and the current data table does not have a :TOTAL
column.
Open( "$SAMPLE_DATA/Big Class.jmp" );
dt=(Data Table( "Big Class" ) << Tabulate(
Add Table(
Column Table( Grouping Columns( :sex ) ),
Row Table( Analysis Columns( :height ), Statistics( Mean ) )
)
)) << Make Into Data Table;
dt<<New Column ("total", numeric, continious);
dt:total<<formula(:F+:M);// this line works by itself but causes error in script
Jordan