I want to use the field calculator to get the sum of a couple of columns. The problem is that some of them has Null Values. I am not able to find a solution. I tried this Python functions:
stack( !basic.Blue_Thickness!, !basic.Green_Thickness!, !basic.Red_Thickness!, !basic.F1_Thickness! )
def stack(*args): myList = list(args) myList = [item for item in myList if (item is not None)] return sum(myList)
def stack(*args): return sum(filter(None, args))
def stack(*args): myList = list(args) for item in myList: if item is None: myList.remove(item) return sum(myList)
The result of all this functions is that I get always NULL back, only if there is a row with no NULL then I get a result.
Background: I have a File Geodatabase with one main table and some tables which joins this table. The calulation takes place only in the main table (source columns and write column). I am using ArcGIS 10.0. The Source of these functions is this discussion: Calculating field in which null values may be present?