Does anyone know of a more efficient way to set up a coded value domain where numerous code values can represent a single description? Here's a snippet to show what I have:
What I'd like to see is something along the lines of:
Code | Description |
0-2 | Low Risk |
3-5 | Medium Risk |
6-8 | High Risk |
or
Code | Description |
0, 1, 2 | Low Risk |
3, 4, 5 | Medium Risk |
6, 7, 8 | High Risk |
The number that will be used to determine risk level is calculated from four other numerical fields, and although I recognize I could set up the script to assign values of 0, 1, or 2 based on those number ranges, it would be nice to not require a workaround like that. I'd like to maintain the actual calculated values, because a High Risk with level 6 is still of lower importance than a High Risk of level 8.
Obviously, this is working as-is, but I was just wondering if anyone had any suggestions for a situation like this where perhaps the code values can range from 0 to 100. Inputting a description for each one of those code values would be a tedious job, even using a script.
Thanks
If you make good use of the script tool parameter types this can be an efficient script tool. I've attached a tool with no code to execute but the parameters and validation already done, this illustrates how you can quickly gather a bunch of code ranges and their associated descriptions, for both new and existing domains.
I'll check that out, thanks
So I'm thinking a calculation attribute rule would be possible in this scenario. The arcade code block in building the attribute rule would be something like this:
var code = $feature.Code;
var description = When(
code == 0 || code == 1 || code == 2, "Low Risk",
code == 3 || code == 4 || code == 5, "Medium Risk",
code == 6 || code == 7 || code == 8, "High Risk",
"Other"
);
return description;
You can make it an immediate calculation rule so when an editor types in the value 1 for the code field, the attribute rule triggers and calculates the Description field to be "low risk". Caveat here - I'm not an arcade guru so the script may need some tweaking.
This stores the code in one field and the description in another, which is different from having a coded-value domain on an integer field. Not strictly wrong, but not as useful as a proper field in my experience.
True. Just another way of looking at the question I suppose.