mercredi 22 janvier 2020

Labeling Expression ArcGIS - If Cell Empty then, else

I am very new to writing expressions and would appreciate a bit of help with my code. I am working with address data. We want to display the street number and #unit number if there is a unit, and just the street number if the unit field is empty. I have mimicked various scripts (VBScript & Python) provided in other helpful posts, but I am still getting the # after the street number if the unit field is empty. I am not sure what I am doing incorrectly. Screenshot of current work

The script I used:
Function FindLabel ( [STNUM] , [UNIT] )
if [UNIT] <> " " Then
  FindLabel = [STNUM] + " " +  "#" + [UNIT]
else
 FindLabel = [STNUM] 
end if
End Function

Any help would be appreciated! Cheers!

Aucun commentaire:

Enregistrer un commentaire