Hello,
I have tried to get a point count with a polygon using the following code:
// address count agol
var p = Portal('https://www.arcgis.com')
// Filter portal layer
var features = Filter(FeatureSetByPortalItem(p, 'xyzxyzxyz', xy), "feature.xy = 'xy'")
// get the points inside the current polygon feature
var points_in_polygon = Contains($feature, features)
// count them and return the number
return Count(points_in_polygon)
However I get the following error:
Invalid expression.
Error on line 1.
Failed to query statistics
When I run it as:
var p = Portal('https://www.arcgis.com')
var features = Filter(FeatureSetByPortalItem(p, 'xyzxyzxyz', xy), "feature.xy = 'xy'")
It runs perfectly but that does not do me any good.
Want I want to do is filter a point layer for specific values and return the count of the features that meet the filtered parameters within a polygon. I can return a value without the filter but for some reason I cannot get it to run when filtering.
Any help is appreciated!
Thanks,