I’m looking to use the field calculator to calculate the number of ‘NOT NULL’ values in a subset of fields within an attribute table.
| Field 1 | Field 2 | Field 3 | Field 4 | Field 5 | Count |
|---|---|---|---|---|---|
| 2 | 3 | Null | 1 | Null | 3 |
I have used the sum(filter(None,Args)) Python script to calculate the sum of the fields but I also want to calculate the number of not null values.
How can I do this?
EDIT
This is my existing code and error message
stack(!Signage_Adequate_Directional!,!Signage_Positive_Wording!,!Signage_Information!,!Signage_Welcome_Sign!,!Signage_Notice_Board!)
def stack(*args):
return len(filter(None, args))

sum()tolen()