I have two fields. One field has an ID. The other field has a list of ID's. Using the Field Calculator I with to calculate 1 or 0 if either field contain the same ID number. I was successful at writing an arcpy row by row query, but there's millions or records and a linear test of rows is not efficient. I need to calculate it in one hit.
I need to take a field and make it's value a wild card and test the other field for that value. I have tried the "*" and "in" methods. But it's not returning the correct value.
Can someone assist me in why this is wrong?
def myCal(reportnumber,spatialjoin): reportnumbercheck = ('*'+(str(reportnumber))+'*') if (reportnumbercheck in spatialjoin): return 1 else: return 0