Equations to open in new data tableI need to calculate two separate equations to open in two columns in a new data table. Is there a way to do so?
Automation and ScriptingRe: Equations to open in new data tableYes, but we'll need more specifics to give a useful answer. What steps do you need to take, and are you looking for a scripting answer, or one that can be accomplished in the GUI?
Re: Equations to open in new data tableIs this what you are talking about. This script creates 2 new columns, each with a different formula:
Names Default To Here( 1 );
dt =
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Column( "one", formula( :height + :weight ) );
dt << New Column( "two", formula( :height / :weight ) );

Re: Equations to open in new data tableJim, thanks for the feedback. I'm looking to run a script where
select where name is Katie and Tim, then height = 59 + 60
In a new table
Names Height Sum
Katie/Tim 119
And then any combinations I specifically call out.
Re: Equations to open in new data tableHere is a simple script that provides one solution
Names Default To Here( 1 );
dt =
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );
theNames = {"KATIE", "TIM"};
theRows = dt << get rows where( dt:name == theNames[1] | dt:name == theNames[2] );
If( N Items( theRows ) == 2,
dt2 = New Table( "Results" );
dt2 << add rows( 1 );
New Column( "Names", character, set each value( theNames[1] || "/" || theNames[2] ) );
New Column( "Height Sum", set each value( Sum( dt:height[theRows] ) ) );
Try( dt2 << delete columns( "Column 1" ) );
);