I have a simple table saved as a feature in ArcGIS Online. The table structure is very simple:


In the last three fields I would like to calculate statistics using arcade:

3,21.03.2020,not confirmed,Hamburg,8,3,3
4,21.03.2020,not confirmed,Hannover,8,3,3
6,24.03.2020,not confirmed,Hannover,8,3,3

Total= would be the total number of records in the table which the following arcade calculation would work.

 var tot = sum($layer)

Here I need help

Sum_typ = should contain the total number or records grouped by type

-any record which is confirmed should have a 5 as this is the total amount of "confirmed" cases in the data.

-any record which is not confirmed should have a 3 as this is the total amount of "not confirmed" cases in the data.

sum_loc = total number of records grouped by location The same as above bur groupd according to location:

therefore any data from Hamburg = 3
therefore any data from Hannover = 3
therefore any data from Bremen =2

I can't do this in any other way as far as I can see apart from with arcade. I need to keep the data dynamic so using a summarize function does not work as this creates a static view which is not updated when new records are added.

1 Answer 1


To count the overall number of records using Arcade:


The following Arcade expression will count the features in the layer with the same "Type" value (of confirmed/not confirmed cases):

    Filter($layer, "Type = '" + $feature.Type + "'")

And similarly for "Location" value:

    Filter($layer, "Location = '" + $feature.Location + "'")

Useful documentation includes https://developers.arcgis.com/arcade/function-reference/data_functions/#filter and https://github.com/Esri/arcade-expressions.

  • thanks for the help. I was wondering in which "profiles" I can use the last two. As a field calculation it doesn't seem to work. Would that be more for labelling or Popups? Mar 28, 2020 at 20:19
  • @RobertBuckley - it's working fine for me when doing field calculations in ArcGIS Online. I used your csv above and tested with arcgis.com/home/… Mar 31, 2020 at 20:10
  • Worked a treat. Is there also a way to calulcate running totals of a certain type according to date? In other words a "sum_dat" column for Type? It tried by altering the Filter according to "Date" but this returned "0" Apr 1, 2020 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.