I need to copy a formula from one data table to another.
The only suggestion I found and managed to get to work is this:
Copy Columns With Formulas
The easiest way is to get the script for the original data table.
data table("Original") << get script;
Now the script appears in the log. Just copy and paste into a new script, keeping only the bits related to adding the the formula columns.
which seems, however, very convoluted and time-consuming when I need to apply it multiple times.
This other method was suggested here: Saving the prediction formula to an existing column?
f = column("prednew") << Get Formula;
column("predold") << Set Formula( Name Expr( f ));
so I tried:
f = data table("table 1") << column("my formula") << Get Formula;
data table("table 2") << column("my formula") << Set Formula( Name Expr( f ));
where 'my formula' already exists, but is empty, in table 2
but it doesn't work, and the log gives no errors.
Any ideas? Is this documented anywhere in JMP's official documentation?