Select to view content in your preferred language

Symbology base on multiple fields Coded Values

370
3
Jump to solution
06-04-2024 11:55 AM
Labels (1)
Heberlyeng
New Contributor II

I am trying to create an expression that will return all coded values from two fields (STATUS and Funding_Source) so that I can symbolize based on the results.

For example. if I have Status's coded values as:

A, B, C

and Funding_Source as:

X, Y, Z

I want symbology for:

A-X, A-Y, A-Z, B-X, B-Y, B-Z, C-X, C-Y, C-Z

If I use concatenate($feature.STATUS,'-',$feature.Funding_Source)

I only get values for populated fields not all coded values)

I tried building an arcade expression:

var STarray = Array(0)
var SD = Domain($feature, 'STATUS').codedValues
var FD = Domain($feature, 'Funding_Source').codedValues
for (var i = 0; i < Count(SD); i++) {
    for (var a = 0; a < Count(FD); a++) {
      Insert(STarray, 0, Concatenate(SD[i].code,'-',FD[a].code))
    }
}
STarray
 
It returns an array of exactly what I want, but it makes 1 symbol with a legend value of the entire array output.
 
Is there a way to symbolize on two fields and get all coded values?
 
Thanks much,
JB
0 Kudos
1 Solution

Accepted Solutions
RhettZufelt
MVP Notable Contributor

In Map viewer symbology, click Expression:

RhettZufelt_0-1717614167193.png

I used:

 

var SD = DomainName($feature, "Status")
var FD = DomainName($feature, "Funding_Source")
return Concatenate(SD,'-',FD)

 

Which, since I already had several of the combinations in the data, it automatically sets up those class values.

Then, I added a new polygon "B-Y" since it wasn't already in the list, but it symbolizes by "Other".

RhettZufelt_2-1717614322652.png

Then, select the three dots and Add Value:

 

RhettZufelt_0-1717614764523.png

And enter the value(s) you want (here I add the missing "B-Y")

And it now symbolizes by the newly added value instead of "Other".

RhettZufelt_1-1717614823276.png

R_

 

View solution in original post

0 Kudos
3 Replies
RhettZufelt
MVP Notable Contributor

In Map viewer symbology, click Expression:

RhettZufelt_0-1717614167193.png

I used:

 

var SD = DomainName($feature, "Status")
var FD = DomainName($feature, "Funding_Source")
return Concatenate(SD,'-',FD)

 

Which, since I already had several of the combinations in the data, it automatically sets up those class values.

Then, I added a new polygon "B-Y" since it wasn't already in the list, but it symbolizes by "Other".

RhettZufelt_2-1717614322652.png

Then, select the three dots and Add Value:

 

RhettZufelt_0-1717614764523.png

And enter the value(s) you want (here I add the missing "B-Y")

And it now symbolizes by the newly added value instead of "Other".

RhettZufelt_1-1717614823276.png

R_

 

0 Kudos
Heberlyeng
New Contributor II

Thanks for the input.  This is what I pretty much ended up doing.  Just would be nice if this could happen without having to add the remainders manually.

 

Thanks again.

0 Kudos
RhettZufelt
MVP Notable Contributor

If I have to do this with many values, I find it easier to just create a features for each value off to the side before I create the symbology.

Once the symbology is created (and saved) you can delete the temp features.

R_

0 Kudos