Hi,
I am trying to define a new column formula from user input. I have tried different combinations of Eval(), Eval Insert(), and Parse() without success. Input can either be columns or lists of columns, plus a scalar. Below is a minimal example. Any suggestions? I am using JMP14, but I hope the solution will work for JMP12 and above.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// Define new column.
dt << New Column( "Mean for Each Age and Sex Group",
Formula( Col Mean( :height, :age, :sex ) )
);
// Define user input.
a = 2;
c1 = :height;
c2 = {:age, :sex};
// Define new column from user input.
dt << New Column( "Mean for Each Age and Sex Group 2",
Formula( Col Mean( a * c1, c2 ) )
);