AnsweredAssumed Answered

Acpy "if", "elif", and "else" statement (ArcGIS Pro)

Question asked by bisoftware on Dec 5, 2017
Latest reply on Dec 5, 2017 by Dan_Patterson

I have a table in my geodatabase that has urgent care patient visits listed by market. I'm trying to develop a script that will select a certain lyrx based on what market the patient visit took place in. From the research I've done, it looks like the "if", "elif", and "else" statements would accomplish what I'm trying to do. 

 

I'm thinking it would something like this:

 

if Market_ID == "1000":
    print "NY_ZipCodes"
elif Market_ID == "2000":
    print "CT_ZipCodes"
elif Market_ID == "3000":
    print "CA_ZipCodes"
else:
    print "This program has an error"
 
Obviously I need to replace the "print" statement (with the exception of "else"), but I don't know what to replace it with. 
Does anyone know what should replace "print"? Am I on the right track? Is there a better way to do what I'm trying to do?

 

Outcomes