I am unsure what syntax issue I am having with my If/Elif statement. I want to not use a column in my calculation if the value is blank. The end goal is to not have extra spaces before, after and between values.
Please be kind. I am still learning Python for scripting in ArcGIS Desktop.
Here is my Prelogic and Expression.
def ifFields(SubAdd,LandM, ZipN): if SubAdd== " ": return "!LandmarkName! + ' ' + '('+ !ZipName! + ')'" elif LandM== " ": return "!SubAddress! + ' ' + '('+ !ZipName!+')'" elif ZipN== " ": return "!SubAddress! + ' ' + !LandmarkName!"
ifField(!SubAddress!, !LandmarkName!, !ZipName!)