I have some data in a table that I would like to perform some statistics and have that placed in a text box on my map Layout. While I could do this by hand, I'd like to do it dynamically so when I update the data later on I don't have to edit my text boxes.

My data looks something like this:

| County | POP2019 | Deaths |
| Benton | 1000    | 2      |
| King   | 100     | 1      |

I want to do a statewide death rate calculation like this

((Sum of Deaths / Sum of Population) * 100) Round to 5 decimals

Round(((Sum($feature.Deaths) / Sum($feature.POP2019)) * 100), 5)

But that dynamic text expression doesn't sum up the column! It prints out each and every row, and does not sum them up.

Expression Results

  • What table are you summarising and what shape are you labeling?
    – FelixIP
    May 4, 2020 at 5:15
  • If your data is in a database (enterprise or file geodatabase) I would create a database view to do this. If you want the results to be dynamic, there are not a lot of other options. May 4, 2020 at 5:42
  • The file is in a Geodatabase feature class, and is part of the dataset currently being displayed on the map. It'm trying to create a text box on my Map Layout with dynamic text. I've already created a few out dynamic text boxes that contain SUMs and MEANs of other columns for other purposes, but I'm having trouble with this formula here.
    – freebird
    May 4, 2020 at 6:18


Your Answer

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

Browse other questions tagged or ask your own question.