Hard to believe I have to create a post for this, seems like something google should find. If a field user draws a polygon that intersects multiple rows, from the same underlying feature, how do I return the maximum value from those rows?
Example screenshot below. User draws red polygon. Field calculation returns 9.
Solved! Go to Solution.
It's certainly the sort of thing that's been posted here before. Try something like this:
// get polygons layer
var poly = FeatureSetByName($map, 'your layer', ['numeric_field'])
// subset intersecting features
var xs_poly = Intersects($feature, poly)
// look for highest value
return Max(xs_poly, 'numeric_field')
It's certainly the sort of thing that's been posted here before. Try something like this:
// get polygons layer
var poly = FeatureSetByName($map, 'your layer', ['numeric_field'])
// subset intersecting features
var xs_poly = Intersects($feature, poly)
// look for highest value
return Max(xs_poly, 'numeric_field')