I have 3 fields in a table that i need to evaluate and return a new value based on the results using the field calculator (PYTHON)
They are: SETSPAID (long) This field must = 0 TYPEOFSERVICE (string) This field must = 1 or 3 STATUS (double) This field can not be 5 or 6
Here is what I have so far:
Pre-logic Script Code:
def calc(f1,f2,f3,f4,f5,f6,f7,f8):
if f4 == f5 and (f1 == f2 or f1 == f3) and (f6 != f7 or f6 != f8):
return 1
else:
return f4
SETSPD =
calc(!TYPEOFSERVICE!, '1', '3', !SETSPAID!, 0, !STATUS!, 5, 6)
When I run this code, it still assigns a 1 when status is 6. Not sure what im doing wrong.