I have a table with over 4000 records and I would like to sum across three different field to get a cumulative score.I have attempted this multiple times in the past but I have been unsuccessful, does anyone know how to perform this function?
I have attached an example table, I would like to sum the three fields in red to the 'Final_Score' field.
Thanks
!a! + !b! + !c!
make the answer field you want active in the table, launch Field calculate, select python parser, field names enclosed in ! marks, but if you actually select the field names in the calculator expression it will add them rather than my example a, b, c
But what did you try where it didn't work?
I figured it out.
1. I need to make the NULL value equal to zero
2. I had to select all the records.
Thanks for the reply
I am looking to do a similar task but instead of three fields, I have 50. Any ideas on how to avoid typing in 50 versions of !attributeA! + !AttributeB! + ...?
Any input would be appreciated.
DaveJ
import arcpy
fields = arcpy.ListFields(<your_feature_class_or_table>)
fieldnames = [field.name for field in fields]
lazyman_string = "!" + "+!".join(fieldnames) + "!"
How is this problem addressed in Pro when <null> is an appropriate value? Is there an 'else if' approach to summarizing across fields but excluding the <null> values? Part 2: How to calculate for the frequency of a 0 or 1 but not <null>?