Select to view content in your preferred language

Symbology - Unique Values with 7 fields

364
2
Jump to solution
12-05-2023 01:35 PM
DerekBernard
Occasional Contributor

I have seven fields representing the days of weeks.  They are Zero or One and I want to color the data based on the One's.  I can only add three Fields to the Symbology / Unique Values area.  If I could add all seven, I would be fine.  Any ideas?

0 Kudos
1 Solution

Accepted Solutions
Robert_LeClair
Esri Notable Contributor

If you use a Custom Arcade expression for Field 1, you can do this.  For Field 1, click the "x" to the right of the dropdown menu.  In the expression box, copy this script (modify if needed) and paste into the box.  Check the syntax by clicking the green check.

var field1 = $feature.Monday;
var field2 = $feature.Tuesday;
var field3 = $feature.Wednesday;
var field4 = $feature.Thursday;
var field5 = $feature.Friday;
var field6 = $feature.Saturday;
var field7 = $feature.Sunday;

return When(
field1 == 1, 'Monday',
field2 == 1, 'Tuesday',
field3 == 1, 'Wednesday',
field4 == 1, 'Thursday',
field5 == 1, 'Friday',
field6 == 1, 'Saturday',
field7 == 1, 'Sunday',
'NoSymbol'
);

 

UniqueValues_Weekdays.JPG

My ArcGIS Pro then shows 7 unique values based upon 1's and 0's from the days of the week attribute fields.

View solution in original post

0 Kudos
2 Replies
Robert_LeClair
Esri Notable Contributor

If you use a Custom Arcade expression for Field 1, you can do this.  For Field 1, click the "x" to the right of the dropdown menu.  In the expression box, copy this script (modify if needed) and paste into the box.  Check the syntax by clicking the green check.

var field1 = $feature.Monday;
var field2 = $feature.Tuesday;
var field3 = $feature.Wednesday;
var field4 = $feature.Thursday;
var field5 = $feature.Friday;
var field6 = $feature.Saturday;
var field7 = $feature.Sunday;

return When(
field1 == 1, 'Monday',
field2 == 1, 'Tuesday',
field3 == 1, 'Wednesday',
field4 == 1, 'Thursday',
field5 == 1, 'Friday',
field6 == 1, 'Saturday',
field7 == 1, 'Sunday',
'NoSymbol'
);

 

UniqueValues_Weekdays.JPG

My ArcGIS Pro then shows 7 unique values based upon 1's and 0's from the days of the week attribute fields.

0 Kudos
DerekBernard
Occasional Contributor

Thanks.  I haven't delved into Expression builder much yet.  This should work nice!