Good Afternoon
Is there a SUM function in the Field Calculator Processor ? I am trying to sum all the values in a field and write this to a new field. Which I then use.
There are a plethora of functions in the Field Calculator Processor, but no SUM function. Is this actually the case ?
Regards.
Jeremy.
Hi Jeremy,
You can certainly sum values in fields:
Processors—Real-time Data Feeds and Sensors (10.6) | ArcGIS Enterprise
Operation | Operator | Example |
---|---|---|
Addition |
|
Expression adds the numeric values from the fields Odom1 and Odom2 to produce a simple summation. String concatenation (for example, "Hello" + "World") is also supported. |
If you have multiple values in one field, you can parse these out using regular expressions into separate fields. You can then sum those values together.
If you post some sample data, I would be able to make a better recommendation.
~Alex
Hi Alex
thanks for getting back to me.
If you had a field of values say
Val
1
2
3
and you used the field calculator processor to sum these values are you suggesting to use the expression Val + Val + Val ? The issue is I won't know the number of values there are in the field until it is written so I need to be able to do something like SUM(Val) and write this to a new field Val_SUM. I then use this field. I'm surprised this function is not in the processor.
Regards.
Jeremy
Hi Alex,
I'm alittle unsure what you mean when you say "parse out" the values in the field. Are you suggesting to put each value in the field "Val" into seperate fields say "Val1", "Val2" , "Val3" etc...then use field calculator to add them ? This seems abit convoluted to me. Why can't you just Sum the values in a single field and write it to a new field ?
Regards.
Jeremy.