Arcade expression to roll up data that is responsive to dashboard map extent?

691
2
07-20-2021 09:44 AM
ADClark
New Contributor II

Working on a dashboard in ArcGIS online. My aim is to create a list-like element in the dashboard that displays the sum of one field, rolled up on (grouped by) another field. I've seen a similar example from the community for getting this to work in a popup (e.g. https://community.esri.com/t5/developers-questions/how-to-use-arcade-groupby-with-top-and-orderby/td...) but I would like this content to be calculated based on the current extent of the map display in the dashboard.

If I approach it by first creating a data expression FeatureSet, I (apparently?) lose the ability to filter that FeatureSet to match the current view extent. (No exposed Globals in the Dashboard Data Arcade Profile)

If instead I try to create an expression in the advanced formatting interface of either the indicator or list element, I lose the ability to execute a "GroupBy" function.

Referencing the clinic example linked above, is there an alternative approach to "GroupBy" that would work to sum up patients by facility name based on map extent, rather than a popup after clicking a polygon?

Or is there some other way to add an arcade expression to a dashboard that I am missing?

Thanks,

Andrew

0 Kudos
2 Replies
SteveRoth
New Contributor II

Andrew,

I have a similar issue and I was wondering if you were able to find a way to make this work?  My datasets are watersheds and pipes.  I've created two data expressions to create series charts that group the pipes by diameters and ages.  I then want the series charts to filter the data spatially by the watershed limits when a watershed polygon is selected.  Unfortunately, the spatial location of the data appears to get lost when it's aggregated in the data expression.  In the FeatureSetByPortalItem function, I've included the geometry of the features, but that didn't fix my issue.

0 Kudos
ADClark
New Contributor II

I did not find a solution to this within the Dashboard/Arcade framework. Due to time constraints I instead had to do this piecemeal for a few select regions using ArcGIS, but I would still appreciate a more authoritative answer if it is currently possible. If not, I would like to make a request of this feature for dashboards.

0 Kudos