Sum the values of a field and paste the sum in another field

7285
4
03-02-2016 12:06 AM
SEDAT_AYDEMİR
New Contributor

I wrote the TOTAL_FREQUENCY values for all rows manually. But I want to  write this values automatically with a script, toolbox or different way. Namely, I want to write sum of column 3 value to all of the the column 5 rows. How can I do it with a script, toolbox or different way automatically?  Please help me....

question.jpg

0 Kudos
4 Replies
AjitkumarBabar
Occasional Contributor II

I found this way, its not one step solution. But might help you.

1. Right click on Frequency field > Statistics > Note the sum value of Frequency.

2. Right click on Total_Frequency Field > Field Calculator > Type sum value and Enter

SEDAT_AYDEMİR
New Contributor

Yes I know that, but I will use this implementation in model builder, so your method is not automatically, a little manually.

0 Kudos
WesMiller
Regular Contributor III

You could use Calculate Value—Help | ArcGIS for Desktop  to return the value to the field calculator

DuncanHornby
MVP Notable Contributor

Wes Miller​'s nifty method uses numpy and a bit of python to work out the sum of the field. Below I offer a "pure" model builder approach which does not call any code, it uses only geo-processing tools.

Capture.PNG

The result of the summary tool is a table with just one row so you get the SUM using the Get Field Value tool and then use in-line substitution in the Calculate Field tool. Note the output of the Get Field Value is a precondition to the Add Field tool.