SQL expression to sum cells in the same field

174
1
07-11-2013 10:14 AM
ShikoNjuno
Occasional Contributor
Does anyone have any expression or code they can offer that I could incorporate into my Calculate Value Tool on Model Builder?
What I'm trying to do is add multiple cells of a given attribute field and output that value as a sum.
Thanks.

Shiko
0 Kudos
1 Reply
ShitijMehta
Esri Regular Contributor
Hi Shiko,

Try this:

Create a model: - Use a selection tool like make feature layer/ Select a layer By attribute/Select to select the records and then pass the output selection to the Summary Statistic Tool : Summing the field  you want to for the selected records > then use the Get Field Value tool (Only works in ModelBuilder) to get the sum value from the statistic table. You can then use this sum value in the tool you want. You can make the output of the summary statistic tool in_memory so that you don't have to save an extra dbf table.

Hope this helps.
0 Kudos