ArcGIS Pro 3.0.4 - Arcade IIf statment not returning the 'else' value!

406
4
04-01-2023 02:53 AM
VincentLaunstorfer
Occasional Contributor III

Hi,

For symbology, I made a simple IIf statment in order to display 'null' values (empty) as 0 in a graduated color scheme. The Arcade if statment is fairly simple. If the 'sector' attribute is 'null', output 0 otherwise keep the existing value.

IIf(IsEmpty($feature.Sector), 0, $feature.Sector);

When the symbology is applied, only 'null' values are displayed as '0' in my graduated colors, but all existing values are ignored and do not display... just like if the 'else' is ignored.

Is there anything wrong?

Iif_Arcade.png

Tags (3)
0 Kudos
4 Replies
VincentLaunstorfer
Occasional Contributor III

Interestingly, if I reverse the logic, if the 'sector' attribute is 'null', keep the existing value, otherwise output 99. I get the same 0 value for the graduated symbology!

 

IIf (IsEmpty($feature.Sector), $feature.Sector, 99);

 

Iif_Arcade2.png

0 Kudos
DanPatterson
MVP Esteemed Contributor

Is the code or you setting the number of Classes to 1?


... sort of retired...
0 Kudos
VincentLaunstorfer
Occasional Contributor III

Classes are set to 1 because only 1 value '0' is computed (or bugged). I cannot change classes to anything else because only '0' exists. Feature having 'null' values do display correctly on the map with the '0' graduated color...

I just discovered that the Arcade IIf statement works correctly with 'Single Symbol' symbology. It looks like IIf custom statment in Symbology using Graduated Colors is not supported in ArcGIS Pro!

0 Kudos
VincentLaunstorfer
Occasional Contributor III

Instead of fiddling with cumbersome IIf arcade statment, I just ticked 'show values out of range' and it works. All features are displayed on the map, whether or not having 'null' values.

Value_Out_of_Ranges.png

0 Kudos