cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
MFVIT
Level IV

JSL for converting a formula to its results

Hello,

I have the following jsl code 

 

dt << New Column( "I (%)", (:Mean * 100) );

 

that takes a column (Mean), multiplies by 100 and create a new column called I(%) with the formula.

 

I do not want the formula but just the result of the calculation in the new column. How can I do this?

 

Many thanks.

13 REPLIES 13
MFVIT
Level IV

Re: JSL for converting a formula to its results

Thank you very much, very useful.
MFVIT
Level IV

Re: JSL for converting a formula to its results

Many thanks.

Re: JSL for converting a formula to its results

You do not need a formula at all. I recommend not using column formulas when scripting unless you want the values to dynamically change after the script is done. So your case could be solved this way:

 

dt << New Column( "I (%)", Numeric, Continuous, Values( (:Mean << Get Values) * 100) );
Craige_Hales
Super User

Re: JSL for converting a formula to its results

Cool!

Craige