Hi,
Looking for help using the Calculate Fields (Multiple) tool. Individually I am able to calculate my two fields successfully. However, when I use the multiple tool, and put both expressions into the code block, it skips the first def Reclass and only carries out the second? I feel like this should be easy to resolve, but cannot work out what i am doing wrong!
I have attached a screen grab of the tool dialogue box and have included the code block below.....
def Reclass(Surface):
if Surface is None:
return 0
elif Surface == "Well Drained":
return 0.5
elif Surface == "Boggy":
return 1
elif Surface == "Standing Water":
return 1.5
elif Surface == "Blocked Drainage":
return 3
def Reclass(Evidence_of_Instability):
if Evidence_of_Instability is "None":
return 1
elif Evidence_of_Instability == "Surface Erosion":
return 1.4
elif Evidence_of_Instability == "Localised Evidence":
return 1.7
elif Evidence_of_Instability == "Extensive Evidence":
return 2
Try renaming one of the def's to Reclass2. I suspect the duplicate function name is why you are getting only the last one
Hi Dan,
Thanks for this, it has worked Still fairly new to model builder/python and assumed that because each Reclass function was followed by a different field, it would carry out both. This does make sense though, so thanks!
no problem