Many thanks - 3 ways to fix my problem
Just via "OK" it didn't work.
Digging deeper - why did it happen ...
Is there a reason why myFormula3 (with substitution of Head and Aggregation) and myFormula4 (with subsequent substitution of Head and Aggregation) don't work? myFormula1 and myFormula2 (just substituting one of both) do.
(same for Jmp 16.2 and Jmp 17)
name Expr(myFormulax) look quite the same:
Name Expr(myFormula1) = Divide(:height, Col Median(:height));
Name Expr(myFormula2) = :height / Col Median(:height);
Name Expr(myFormula3) = Divide(:height, Col Median(:height));
Name Expr(myFormula4) = Divide(:height, Col Median(:height));
Unfortunately, before saving an re-opening the file none of the above 3 solutions work
Would be nice if a Current Data Table() << Rerun formulas; could solve the problem.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
myFormula1 = Expr(__myHead__( :height,Col Median( :height ) ));
Substitute Into( myFormula1,
Expr( __myHead__ ), Expr( Divide ),
);
myFormula2 = Expr(Divide( :height, __aggregation__( :height ) ));
Substitute Into( myFormula2,
Expr( __aggregation__ ),Expr( Col Median )
);
myFormula3 = Expr(__myHead__( :height, __aggregation__( :height ) ));
Substitute Into( myFormula3,
Expr( __myHead__ ), Expr( Divide ),
Expr( __aggregation__ ),Expr( Col Median )
);
myFormula4 = Expr(__myHead__( :height, __aggregation__( :height ) ));
Substitute Into( myFormula4,Expr( __myHead__ ), Expr( Divide ));
Substitute Into( myFormula4,Expr( __aggregation__ ),Expr( Col Median ));
Show( Name Expr( myFormula1 ) );
Show( Name Expr( myFormula2 ) );
Show( Name Expr( myFormula3 ) );
Show( Name Expr( myFormula4 ) );
Eval( Substitute( Expr( New Column( "new1", Formula( __f__ ) ) ), Expr( __f__ ), Name Expr( myFormula1 ) ) );
Eval( Substitute( Expr( New Column( "new2", Formula( __f__ ) ) ), Expr( __f__ ), Name Expr( myFormula2 ) ) );
Eval( Substitute( Expr( New Column( "new3", Formula( __f__ ) ) ), Expr( __f__ ), Name Expr( myFormula3 ) ) );
Eval( Substitute( Expr( New Column( "new4", Formula( __f__ ) ) ), Expr( __f__ ), Name Expr( myFormula4 ) ) );