cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
How to use a variable value in a formula

If you use a global variable in your column formula, the formula might function normally in your current session of JMP®, but when re-opening the application, the global variable will be nonexistent thus the formula will not evaluate properly.

Instead of using the variable directly in the formula, you should substitute the variable value in its place. The function, Eval Expr() can be used for this purpose.

Here is example code that uses the function to perform the task:

dt = Open( "$SAMPLE_DATA/big class.jmp" ); 
myConstant = 25;
Eval( Eval Expr( dt << New Column( "Weight Plus", numeric, continuous, Formula( :weight + Expr( myConstant ) ) ) ) );

 

[Previously JMP Note 41824]

Details
Operating System
macOS Windows
Products JMP JMP Pro