Hello,
I am having issues with calculating a field using arcade. I'm trying to use a when statement to return my calculation value based on attributes of other fields. I have symbolid and acres fields that I want to use to calculate a number of plots field. Basically, if symbol id equals 2, I want number of plots to equal one. If symbolid does not equal 2, I want the number of plots to be binned based on acres.
This is what I wrote originally and I can't seem to figure out what's wrong.
return When(
$feature.SymbolID = 2, "1",
$feature.acres >= 40, "8",
$feature.acres >= 20, "7",
$feature.acres >= 10, "5",
$feature.acres >= 0, "3",
"<Null>"
);
The code works if I don't include the symbolid part, but I don't know why that would be if the code returns a value as soon as one condition is met.
return When(
$feature.acres >= 40, "8",
$feature.acres >= 20, "7",
$feature.acres >= 10, "5",
$feature.acres >= 0, "3",
"<Null>"
);
Much appreciated.
Solved! Go to Solution.
Try using Comparison Operator equal to: ==
$feature.SymbolID == 2, "1",
Try using Comparison Operator equal to: ==
$feature.SymbolID == 2, "1",
Thank you, this worked.