Hi, I am trying to create a dashboard where I would spatially query two layers (point and polygon). I need to return the number of points lying in each polygon to a sheet. In Mapviewer this is not a problem using the arcade language, but I have spent many hours in the dashboard with no result. I am attaching the code that works in Mapviewer and I need to get it into Dashboard.
var osoby=FeatureSetByName($map,"Dopravní nehody / Traffic accidents")
var pocetOsob=Count(Intersects(osoby, $feature))
var intersectArea=Intersects(FeatureSetByName($map,"Traffic accidents"),$feature )
var list_pricin= groupBy(intersectArea, "id", {name:"count", expression: "id", statistic: "COUNT"})
var pocet= Count(list_pricin)
return pocet