Nulls are a little tricky. You could give something like this a try.if not ID or not OPER_MAINT_LEVEL: return SYMBOL
if not ID or not OPER_MAINT_LEVEL: return SYMBOL
def myfunc(SYMBOL,ID,OPER_MAINT_LEVEL): if not ID or not OPER_MAINT_LEVEL: return SYMBOL if ((ID == "4648" and OPER_MAINT_LEVEL == "1 - BASIC CUSTODIAL CARE (CLOSED)") or (ID == "4654") or (ID == "4663C" and OPER_MAINT_LEVEL == "1 - BASIC CUSTODIAL CARE (CLOSED)")): return 4 else: return SYMBOL Expression: SYMBOL = myfunc(!SYMBOL!, !ID!, str(!OPER_MAINT_LEVEL!) )
I think you want to do this.def myfunc(SYMBOL, ID, OPER_MAINT_LEVEL): if ((ID == "4648" and OPER_MAINT_LEVEL == "1 - BASIC CUSTODIAL CARE (CLOSED)") or (ID == "4663C" and OPER_MAINT_LEVEL == "1 - BASIC CUSTODIAL CARE (CLOSED)") (ID == "4654")): return 4 else: return SYMBOL
def myfunc(SYMBOL, ID, OPER_MAINT_LEVEL): if ((ID == "4648" and OPER_MAINT_LEVEL == "1 - BASIC CUSTODIAL CARE (CLOSED)") or (ID == "4663C" and OPER_MAINT_LEVEL == "1 - BASIC CUSTODIAL CARE (CLOSED)") (ID == "4654")): return 4 else: return SYMBOL
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.