Arcade GroupBy Function

312
4
10-06-2021 12:52 PM
Status: Open
AaronWeier1
New Contributor II

Need to use the Arcade GroupBy function in the online map viewer to calculate averages and symbolize the calculated averages. 

4 Comments
jcarlson

That's actually a limitation in the symbology profile in Arcade. When symbolizing features with Arcade, you can only access the individual feature's attributes, not the rest of the layer. I don't expect that's going to change anytime soon.

Where were you hoping to use this function to symbolize features? If it's a Dashboard, you could use a Data Expression instead. Otherwise, you'd probably need to manually input values or use Field Calculate.

AaronWeier1
Thanks for the quick response. I have years worth of data, for multiple parameters, that I was hoping I could calculate averages for on-the-fly and symbolize in a map layer based on predefined class breaks. Each parameter would be a layer in a web app that contains a filter. Users would be able to choose their own date range. After the user applies a date filter, arcade would calculate the averages for the selected time period, and the layer would update based on the calculated average and predefined symbology. Was hoping to do this in the AGO map viewer so I wouldn't have to do it in a custom JSAPI app.
jcarlson

It sounds really cool, but dynamic symbology isn't something I've seen. But I could still see a way of doing this with a Data Expression if there was a set number of date filters you wanted to make.

AaronWeier1
I'll take a closer look at Data Expression as an option. Thanks again for the quick replies!