Expression to label coded values with a name

217
0
05-12-2019 12:39 AM
TimEatwell
New Contributor

I am trying to write a label class expression that will allow me to label polygons with a name (text code) rather than the number code in the source field. I have tried two options using a select case and elseif function, but I can't get it to work. Any help would be much appreciated.

Function FindLabel ([Type])
If '1' Then
Findlabel = 'SR'
ElseIf '2' Then
Findlabel = 'HG'
End If
End Function

 

or alternatively:

 

Function FindLabel [Type]

Select Case
Case '1' output = 'SR' 
Case '2' output = 'rg' 
Case '3' output = 'sg' 
Case Else output = [Type] 
End Select 
End Function

Tags (1)
0 Kudos
0 Replies