Testing this in the Arcade Playground, the error that occurs happens whether I use an IF or a WHEN statement.
The goal is to round up if the number is >= x.75, round down is the number is < x.75 and not to round at all if the number is x.00.
Code:
//Some variables instead of referencing geodatabase fields which Playground doesn't understand.
var Life80=5.5
var LSY=2020
//Determine if date is before or after FY start of September 1
Var RoundDown = Floor(Life80,0);
//Additions to simplify formula
Var StraightAdd = Round(LSY+Life80,0);
Var AddRound = LSY+RoundDown;
//Constrain to current year minimum and ridiculously later year maximum
Iif((Life80=RoundDown), StraightAdd, (Iif((Life80-0.75)<RoundDown, Constrain(AddRound,2022,9999), Constrain(StraightAdd, 2022,9999))));
//Alternate expression: When(Life80=RoundDown, StraightAdd, (Life80-0.75)<RoundDown, Constrain(AddRound,2022,9999), (Life80-0.75)>RoundDown, Constrain(StraightAdd, 2022,9999),9999);
Error:
Execution Error:IF Function must have a boolean test condition
Question: Is there something off about my syntax? Have been looking through the ESRI community and have seen multiple examples of IF and WHEN statements and the syntax is just as above as far as I can tell. I feel as if I'm missing something really obvious, but I don't see it. Any insight would be appreciated!