I'm looking to get the frequency of points within 2 polygons in my map's pop ups.
points -> poles
polygon 1 -> inspection grids (filtering on inspection year)
polygon 2 -> municipalities
set up: Our engineering group would like to compare the number of poles to be inspected with the completed inspections. Poles are inspected by grids, but they need the count within the municipality for permitting. I have been able to get the count of poles in each grid and the count of poles in each municipality, but I can't seem to figure out how to get the count of poles to be inspected (in the grids) by municipality.
In ArcMap/Pro, I would complete this task by the following workflow:
-Select by Location: select poles within the grids (this produces the poles to be inspected)
-Spatial Join: the selected poles to be inspected within the municipalities
-Frequency: the number of poles to be inspected in each municipality
current expression being used to get the count of poles by muni:
var poles = FeatureSetByName($map,"Poles")
var polesInMuni = Count(Intersects(poles,$feature))
return polesInMuni
I attached a snip of a highlighted muni, let's call it "Home". the blue dots that fall within Home and the 2 overlapping grids are the ones I need to count.