if condition1 or condition2 then value1 else value2 if condition1 and condition2 then value1 else value2
: means if the month is Nov, Dec, Jan or Feb, return 90% else return 100%.if month in [11, 12, 1, 2] then 90% else 100% You can also use dimensions/dimension items in if-statements, for more information, see .Dimension Items in Formulas
: means if the month isn't Nov, Dec, Jan or Feb, return 90%, if it is return 100%.if month not in [11, 12, 1, 2] then 90% else 100%
if condition1 then value 1 else if condition2 then value2 else [...]
\
You can break each of these layers out onto separate lines of your formula editor using .Shift + Enter Note that every if statement must have an else, otherwise xP&A will return an error.
if timestep > 4 then 1 else 0 if variable1 > variable2 then 100 else 200 if timestep > 4 and timestep < 10 then 1 else 0 if variable1 < 10 then 100 else if variable1 < 20 then 200 else 300
Last updated on Aug 16, 2023