I am trying to calculate a field in a model builder, using if statements.
In the 'Calculate Field' window, I create a new attribute 'perturbateur' (string)
the formula to calulate this attribute refers to a code Block below, which shows no error. But I only get null values.
perturbat=
computeType(!FID_Buffer_coupes_Dissolve!, !FID_Reboisement_Dissolve!)
Code Block
def computeType(fid_c, fid_r):
if fid_c== 1 and fid_r==1:
perturbat = 'coupe et reboisement'
elif fid_c== 1:
perturbat = 'coupe'
elif fid_r==1:
perturbat = 'reboisement'
Could you help me understanding what is wrong ?