Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Level I

Variables Not Defined in Formula in the script

I am trying to create a new formula column using variables that were calculated earlier in the script, but the formula does not like the way the variables are defined. When I open the formula (after the data table is created) I see this error "This name exists in the current context but is not defined locally in the formula."


//Checks the calibration accuracy
current data table(dt_1C_comparison);
Avg_1C_grab = :"New Diff." << get values;
Avg_1C_diff = mean(Avg_1C_grab);
offsetadjust_1Cpos = Avg_1C_diff - 0.3;
offsetadjust_1Cneg = Avg_1C_diff + 0.3;
x1C = If(
(Avg_1C_diff > 0.3), offsetadjust_1Cpos,
(Avg_1C_diff < -0.3), offsetadjust_1Cneg,
Avg_1C_diff = 0,
current data table(dt_1C_comparison);
//Caclulates new offset if the wet/dry difference is greater then 0.3
Offset_1C = Mean1C_intercept - x1C;

New Column("Wet Avg. 2", numeric, "continuous", Format("Best", 5), Formula(:"Average of Meas. Position=TopDRY" * Slope_1C + Offset_1C));


Slope_1C variable is calculated earlier in my script and works in a previous new column formula. 

I'm not sure why this formula does not like the variables Slope_1C and Offset_1C


Any help would be greatly appreciated!

Article Labels

    There are no labels assigned to this post.