Hello,
I'm using ArcGIS Pro to calculate total percent of parcels in a hazard zone. For this I used the tabulate intersection tool, and successfully was able to get a pivot table that shows each parcel in a city limit that overlaps with a certain hazard. Right now, I am working with flood data, so my pivot table's has A, AE, VE, and X flood zone fields. Since there are over 3,000 parcels, I don't want to calculate what parcel is in what flood zone manually, so I created a new field "High_Zone". I was going to use the stats with city and flood zone as my axes, but the graph repeats parcels because I did not specify any overlap classification.
The classification I need to use is: if a parcel is 45% or more in a zone, then I will say that whole parcel is in that zone. But, I want to make sure that the parcels that are 45% or more in zone X to be prioritized before any other zone since it is more dangerous. So, I tried doing this code block in my High_Zone field, but am running into errors. I am using Arcade (but I did try using python but also ran into issues -- got the error on line 1, identifier expected, but I before I redid my code I kept getting open parenthesis expected).
For more clarity:
My pivot table looks like this:
I want High_Zone field to output a flood zone with more than 45% (I do use 44.5% in my code because I think that range is still very close enough to classify as primary hazard in that parcel)
| Parcel ID | City | A | AE | VE | X | High_Zone |
| 123456 | xyz | null | 51.2 | null | 44.5 | X (although AE if higher %. because I am going for ~45% I want to include 44.5% of X, the more dangerous hazard) |
| 78910 | AAAA | 73 | 10 | null | null | A |
if ($feature.A >= 44.5) {
return "A"
} if ($feature.AE >= 44.5) {
return "AE"
} if ($feature.VE >= 44.5) {
return "VE"
} if ($feature.X >= 44.5) {
return "X"
}
if ($feature.A >= 44.5) {
return "A";
}
if ($feature.AE >= 44.5) {
return "AE";
}
if ($feature.VE >= 44.5) {
return "VE";
}
if ($feature.X >= 44.5) {
return "X"
}
Edit: I just tried the second code and I got no errors, but aside from one AE, and all A, all outputs are null