arcade for pop-ups

349
1
Jump to solution
02-11-2021 05:08 AM
Labels (1)
NadimHammoud
New Contributor II

Hi, in arcade for pop-ups, im intersecting two polygons layers. how to calculate the sum of selected(Intersected) records

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Notable Contributor

You should spend some time looking at the Arcade Function Reference, and test things out in the Playground.

What you're attempting to do is very simple, but it helps if you know what data types you're dealing with. Intersects, for example, returns a FeatureSet of all intersecting features from your inputs. (Not to be confused with Intersection, which returns the shape of the overlap between exactly two geometries.)

Thankfully, the Arcade function Sum does take a FeatureSet as an input.

var inter = Intersects(layer_a, layer_b)

return Sum(inter, 'field-to-sum')

It's also worth looking at GroupBy, which can take a FeatureSet and return all sorts of statistics for multiple fields.

- Josh Carlson
Kendall County GIS

View solution in original post

1 Reply
jcarlson
MVP Notable Contributor

You should spend some time looking at the Arcade Function Reference, and test things out in the Playground.

What you're attempting to do is very simple, but it helps if you know what data types you're dealing with. Intersects, for example, returns a FeatureSet of all intersecting features from your inputs. (Not to be confused with Intersection, which returns the shape of the overlap between exactly two geometries.)

Thankfully, the Arcade function Sum does take a FeatureSet as an input.

var inter = Intersects(layer_a, layer_b)

return Sum(inter, 'field-to-sum')

It's also worth looking at GroupBy, which can take a FeatureSet and return all sorts of statistics for multiple fields.

- Josh Carlson
Kendall County GIS