I have to manipulate data using various formulas and store the output in one final column. I am able to apply the formula successfully and store data in a new column but not in the same column.
For example,
In this table,
![example.PNG example.PNG](https://community.jmp.com/t5/image/serverpage/image-id/10149iB2877378794D0969/image-size/large?v=v2&px=999)
I am using Formula(abs(Divide(Effect,Subtract( USL,Mean)))*100)) for cells where USL values are present and
Formula(abs(Divide(Effect,Subtract( Mean,LSL)))*100)) where LSL values are present. But for cells where the column name, LSL, and USL are empty, I want to use the formula: Formula(Divide(abs(Effect)), Mean);
The script I am currently working on is:
dtq = Open("path\formula.jmp");
a = dtq << New Column("Final", Formula(abs(Divide(Effect,Subtract( USL,Mean)))*100));
//);
//:Final << Formula(abs(Divide(Effect,Subtract( USL,Mean)))*100);
b = dtq << New Column("Final1",Formula(abs(Divide(Effect,Subtract( Mean,LSL)))*100));
If( Is Empty( dtq << ColumnName ),
:Final << Formula(Divide(abs(Effect)), Mean);
);
show(b);
The output I get now is:
![example.PNG example.PNG](https://community.jmp.com/t5/image/serverpage/image-id/10150iC7C490E154999A57/image-size/large?v=v2&px=999)
whereas I want the values of Final1 to be in the same column. Also,
this part of the script:
If( Is Empty( dtq << ColumnName ),
:Final << Formula(Divide(abs(Effect)), Mean);
);
does not show any error but is not working as well. Thank you for any help.