1

I am using ArcGIS Pro, field calculator to add the values of two fields (Result_A and Result_B) and assign the value to new Field Combined_Result. The type for all three fields is "double". Both fields for Result_A and Result_B have some cells with null values. This is generating errors in their addition. In the Calculate Field window (for field Combined_Result) For the calculate field, I am using the following expresssion:

=!Result_A! + !Result_B!

I get the following error:

WARNING 002858: Certain rows set to NULL due to error while evaluating python expression: TypeError: unsupported operand type(s) for +: 'float' and 'NoneType'

I have tried changing the fields to float but get the same error.

Should I convert null values to zero before running the expression?

I have beginner's level python skills and can set up a code to convert null values if you point me in the right direction.

1 Answer 1

1

I did not have to convert the null value cells to zero. Instead I wrote the following code block in the "Calculate Field" window for Combined_Result

= ((!Result_A! or 0) + (!Result_B! or 0))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.