Select to view content in your preferred language

How can I concatenate attributes into a single new attribute?

1527
2
03-08-2017 01:42 AM
EllenWildig
Deactivated User

I have a set of point data containing attributes for their assignation code and the number of each feature found at that particular point. I want to label the features with both of these attribute concatenated together. eg; if the code is BC and the number is 12, the label reads 12BC. How do I set up a new attribute which combines both of these so I can assign the labels. Also, is there a way to filter out the concatenation where the number value is 1. eg; code = BC, number = 1 resulting label = BC?

Thanks

0 Kudos
2 Replies
JayantaPoddar
MVP Esteemed Contributor

You could Use label classes to label features from the same layer differently.

Class 1::

Use SQL Query : [Number] = 1

Label Expression:

Class 2::

Use SQL Query: [Number] > 1

Label Expression: [Number] +



Think Location
DanPatterson_Retired
MVP Emeritus

Or you can add a new text field and concatenate the results of the two fields and use that field for labelling

python parser

!field1! + str(!field2!)

where field1 is the field with BC in it and field2 is the one with the numbers