This is what we have used in the past. But I either get "Carriage reurns are not allowed in simple expressions" or "This expression contains an error".Function FindLabel ( [PartyName] ) Owner = [PartyName] if InStr ( 1 , Owner , "," ) > 1 then MyPos = InStr ( 1 , Owner , "," ) DisplayChars = Left ( Owner , MyPos + 2 ) FindLabel = DisplayChars else FindLabel = Left ( Owner , 13 ) end ifEnd Function
It worked! Thank you so much for your help!!! It is very much appreciated!
Function FindLabel ( [PartyName] ) if InStr( [PartyName] , ",") > 0 Then myArray = Split( [PartyName] , ",") FindLabel = myArray(0) & ", " & LEFT(Trim(myArray(1)), 1) & "." ElseIf Len( [PartyName] ) > 13 Then FindLabel = Left([PartyName], 13) Else FindLabel = [PartyName] End If End Function
I am needing to label a map with owner names but I would like to trim the name to one character after a comma. I also have owner names that are not divided by a comma so I would like to trim them to a 13 characters. I am having trouble writing the expression for this. Any help would be great.
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.