Hi,
I have a shapefile with 12000+ parcels and in each one different fields have null values. I need to fill in the information in all of them so in order to track my progress I created a new field called 'Missing' according to what is missing in each parcel using this code:
-------------------------------------------------------------------------------
Missing =
calc(¡Plotno!,¡Activity!,¡AllowedHei!)
def calc(Plotno, Activity, AllowedHei):
if Plotno is None and Activity is None and AllowedHei is None:
return 'Plotno, Activity, AllowedHeight'
elif Plotno is None and Activity is None and AllowedHei is not None:
return 'Plotno, Activity'
elif Plotno is None and Activity is not None and AllowedHei is not None:
return 'Plotno'
elif Plotno is not None and Activity is None and AllowedHei is None:
return 'Activity, AllowedHeight'
elif Plotno is not None and Activity is None and AllowedHei is not None:
return 'Activity'
elif Plotno is None and Activity is not None and AllowedHei is None:
return 'Plotno, AllowedHeight'
elif Plotno is not None and Activity is not None and AllowedHei is None:
return 'AllowedHeight'
else:
return 'Complete'
-------------------------------------------------------------------------------------------
This worked perfectly but when I modify anything on my table (eg. I add Plotno information on a parcel that had a null value on that field) the value in the 'Missing' field won't change accordingly. Is there any way to update the 'Missing' field everytime I enter information? That would be super helpful to track my progress.
Many greetings,
Marta