I have a shapefile containing two numeric fields ("Dist_1" and "Dist_2"). I want a Field Calculation that will populate an additional field ("Result") with one of three answers:
First if Dist_1 is greater than Dist_2 populate Result with 'True' Second if Dist_1 is less than Dist_2 populate with 'False' and Third if Dist_1 and Dist_2 are equal populate with "Equal"
Answer
Parser:
Python
Code block:
def calc(f1,f2):
if f1 > f2:
return "True"
elif f1 < f2:
return "False"
else:
return "Equal"
Expression:
calc(!Dist_1!, !Dist_2!)
Or graphically (you cannot see all of the code block here unfortunately)
No comments:
Post a Comment