Symbolizing Unique values with wildcards

1470
18
Jump to solution
03-27-2023 11:47 AM
BrianBulla
Occasional Contributor III

So I need to symbolize based on two attributes:  the INSP_STATUS and the Subtype.  If there is no INSP_STATUS (ie. = null), than each subtype will have a different symbol.

But....if there is an INSP_STATUS (ie. a few different options), than regardless of the Subtype, they can all be the same symbol.  This is what I have so far....a symbol for each subtype:

BrianBulla_1-1679942740899.png

 

When I try to add a custom value with some conditional statement for the "YES" INSP_STATUS to cover all of the sybytpes, I just get an error:

BrianBulla_0-1679942694097.png

Does anyone know how to accomplish this??  Or do I just need to make a symbol for every possible combination of INSP_STATUS and Subtype??

 

0 Kudos
1 Solution

Accepted Solutions
JohannesLindner
MVP Frequent Contributor

You can use an Arcade expression as unique value field (click the expression button on the right of the field). Something like this should do what you want:

// for features without INSP_STATUS, return the subtype
if(IsEmpty($feature.INSP_STATUS)) {
    var subtypes = ["MaintenanceHole", "InspectionMH", "BackFlow", "DiversionMH", "FlapGateMH"]
    var i = $feature.SubtypeCD - 1
    return subtypes[i]
}
// for features with INSP_STATUS, return a default value
return "YES"

 


Have a great day!
Johannes

View solution in original post

18 Replies
SLouq
by MVP Regular Contributor
MVP Regular Contributor

Can you change your primary symbology to Manual Breaks and categorize the symbology that way? Just click the more option and select show values out of range for the null option

0 Kudos
BrianBulla
Occasional Contributor III

Manual Breaks??  I'm not sure what you are talking about.  I'm using Unique Values with two attributes....Subtype Code and INSP_STATUS.  I'm not symbolizing numerical data.

0 Kudos
SLouq
by MVP Regular Contributor
MVP Regular Contributor

Maybe you can't use Manual Breaks then. Try different Primary symbology and see if you can accomplish your goal that way. 

0 Kudos
DanielMiranda2
Occasional Contributor

Could you use the "show all other values" option?

DanielMiranda2_0-1679945532177.png

 

Since you already specify symbols for all subtypes when there is not an insp_status, and want everything else to be the same symbol, then that should be "all other values" if I understand correctly.

0 Kudos
BrianBulla
Occasional Contributor III

All other values would work if I only had one type of INSP_STATUS, but I have 4 different values that INSP_STATUS could possible be.

So 5 types of subtypes and 4 types of INSP_STATUS.  That's a total of 20 different combinations of symbols if I did it all manually, but there has got to be a better way of doing this.

0 Kudos
SLouq
by MVP Regular Contributor
MVP Regular Contributor

try creating a style for your attributes, then base your symbology off that style

0 Kudos
LindaWilliams1
Occasional Contributor

Use Unique Values, set Field 1 as INSP_STATUS, and then create an expression to concatenate INSP_STATUS and Subtype. That will give you symbols for all possible combinations. For the combinations that have an INSP_STATUS, select them in the symbols list then right click any one of them and select Group values.

0 Kudos
JohannesLindner
MVP Frequent Contributor

You can use an Arcade expression as unique value field (click the expression button on the right of the field). Something like this should do what you want:

// for features without INSP_STATUS, return the subtype
if(IsEmpty($feature.INSP_STATUS)) {
    var subtypes = ["MaintenanceHole", "InspectionMH", "BackFlow", "DiversionMH", "FlapGateMH"]
    var i = $feature.SubtypeCD - 1
    return subtypes[i]
}
// for features with INSP_STATUS, return a default value
return "YES"

 


Have a great day!
Johannes
BrianBulla
Occasional Contributor III

Thanks Johannes.  Arcade to the rescue again!  I will check this out and see if I can get it to work.

0 Kudos