Arcade Expression, Sum by key

2230
3
Jump to solution
09-10-2020 08:20 AM
BenjaminMittler
Occasional Contributor III

Hi All,

Im attempting to write an arcade expression an i'm a little lost. I have a layer where each day features are added for each county in our state along with a count for how many new COVID-19 cases occurred that day. I would like to write an expression that returns the sum of the count field for each individual county. If done correctly the expression would combine the daily cases for each individual county and i would be able to symbolize a map with the total cases for that county.

Can anyone point me in the correct direction?

0 Kudos
1 Solution

Accepted Solutions
XanderBakker
Esri Esteemed Contributor

Hi Benjamin Mittler ,

That would require a field calculation that needs to be done every day to update the total amount of cases, since the symbology profile does not provide access to other data than the that held by the feature itself. So if you have multiple records for a county, you would need to access those records and calculate the sum. If doing a field calculation every day (or setting up a scheduled task in Pro to do this automatically) is not a problem, please post some more information on how your data is structures, to provide some more detailed information.

The pop-up on the other hand does have access to other layer and features and can provide a sum of the cases for each county.

View solution in original post

0 Kudos
3 Replies
XanderBakker
Esri Esteemed Contributor

Hi Benjamin Mittler ,

That would require a field calculation that needs to be done every day to update the total amount of cases, since the symbology profile does not provide access to other data than the that held by the feature itself. So if you have multiple records for a county, you would need to access those records and calculate the sum. If doing a field calculation every day (or setting up a scheduled task in Pro to do this automatically) is not a problem, please post some more information on how your data is structures, to provide some more detailed information.

The pop-up on the other hand does have access to other layer and features and can provide a sum of the cases for each county.

0 Kudos
BenjaminMittler
Occasional Contributor III

Hi Xander, 

Thanks for the help, the information provided is correct. I was able to get the arcade expression working in the popup but it is not supported within the symbology expression. I ended up having to create a field to host the sum data and created a script to rerun a field calculator expression daily. 

XanderBakker
Esri Esteemed Contributor

Hi bem08c , 

Thanks for posting back your solution. Hopefully we will be able to use attribute rules in ArcGIS Online soon, so you can trigger these calculations automatically when edits are posted and you won't have to create any scripts. 

0 Kudos