How to populate a new column with a conditional statmentI would like to populate column = = :Cost Set_2 with the same data as from column == :Cost Set
Except if column == :Mon_Yr == 03/2022 AND :Cost Set=="ACTUAL_PAID" THEN :Cost Set_2 == "ACWP"
I have a formula script that but I could not get it to work:
If( Char( Format( :Mon_Yr, "m/y" ) == "03/2022" ) & (:Cost Set == "ACTUAL_PAID")),
"ACWP",
Also instead of using "03/2022" I'd like to set this upfront in the jsl code as global variable, how can I do that?
ScriptingRe: How to populate a new column with a conditional statmentYou had a misplaced ")". Try this:
If(Format( :Mon_Yr, "m/y" ) == "03/2022" & (:Cost Set == "ACTUAL_PAID"),
"ACWP","")
Re: How to populate a new column with a conditional statmentProbably this will work:
::DATE_SELECT = "03.2022";
If( Format( :Mon_Yr, "m.y" ) == ::DATE_SELECT & :Cost Set == "ACTUAL_PAID",
"ACWP",
:Cost Set
);
Instead of setting global variable within the formula code, you can set it elsewhere also.
Please see that my date format is different due to different language settings.
To avoid Syntax problems, I like to use Crtl-M (reformat code) to let JMP show me problems in my (formula) code.
See also help and Scripting index, how to use global variables.
Global and Local Variables (jmp.com)
