I'm not the greatest with Python so I can easily get confused with indentations and such among other things.
Currently I want to create a label expression to do the following and am only able to get it to work with 2 conditions and not the 3rd.
Field Names
[NAME]
[ALT_NAME]
[WIDTH] = Numeric
I want to display these 3 fields only if they are not null or any combination of them that aren't null.
Originally I was only doing this with [NAME] and [ALT_NAME], and the code for this allows me to display either NAME or ALT_NAME or Both if they aren't (None, "", "<Null>"
def FindLabel ( [ALT_NAME], [NAME] ):
if [ALT_NAME] in (None, "") or [ALT_NAME] in (None, "0"):
return [NAME]
elif [NAME] in (None, "") or [NAME] in (None, "<Null>"):
return [ALT_NAME]
else:
return [NAME] +'\r\n'+ [ALT_NAME]
This works fine. However when trying to add in the [WIDTH], I want it to only display that if it is not null or equal to 0.
So far I've been trying too many things to list on here and nothing seems to work. I'm not sure if I'm indenting things wrong or using the .strip() wrong (either using it or not using it) and so on.
I just want a code that only shows any combination or any of these that don't have blank or <Null> values (or 0 as well for the [WIDTH]).
I know the code is probably a little messed up from the start, but again, I'm not all that familiar with Python...