Xander:
You've been my go-to person for all things Arcade. Is there any chance you can help me here?
I have a field (StatusDate, type = date) that needs to be displayed in a popup. When that date is 12/31/22 I want to ignore the value and leave it blank. All other values will be shown.
I have tried these expressions and they do NOT ignore the 12/31/22 values.
1) IIF(Find(12/31/22,$feature.StatusDate) > -1, "", $feature.StatusDate)
2) IIF(Find('12/31/22',$feature.StatusDate) > -1, "", $feature.StatusDate)
3) IIF($feature.StatusDate == 12/31/22,"", $feature.StatusDate)
4) IIF($feature.StatusDate == '12/31/22',"", "$feature.StatusDate")
In the feature class I only see the date value in the format above. When I open the attributes via AGO I see "12/31/22, 6:00 PM".
Can you, or anyone else for that matter, help?
Solved! Go to Solution.
This is one calculation that works:
IIF($feature.LASTUPDATE > Date(2022,11,31) && $feature.LASTUPDATE < Date(2023,0,1), " ", $feature.LASTUPDATE); //month is zero-based
This is one calculation that works:
IIF($feature.LASTUPDATE > Date(2022,11,31) && $feature.LASTUPDATE < Date(2023,0,1), " ", $feature.LASTUPDATE); //month is zero-based
That worked. Thank you very much.
Hi @AdamGebhart , I am glad that @KenBuja shared a good solution.
Apart from the solution provided by Ken, there are many ways to do this.
You can compare by exact date and time (probably the date has a time like 6 pm since it is stored as UTC date time and there is a difference between your local time zone and UTC):
if ($feature.StatusDate == Date(2022, 11, 31, 18, 0, 0)) { ... }
Another way (when the time does not matter) is to translate it to text and compare it as a string:
if (Text($feature.StatusDate, "M/D/YY") == "12/31/22") { ... }
Those worked too. Thank you.