0

I am using ArcGIS Pro.

I have a table with several objects that are identical with the exception of one field that has several unique values.

How can I merge these multiple features into one and have the unique values added to that feature as new individual fields?

from:

+---------+---------+---------+
| Field 1 | Field 2 | Field 3 |
+---------+---------+---------+
| a       | b       | c       |
| a       | b       | d       |
| a       | b       | e       |
+---------+---------+---------+

to :

+---------+---------+---------+---------+---------+
| Field 1 | Field 2 | Field 3 | Field 4 | Field 5 |
+---------+---------+---------+---------+---------+
| a       | b       | c       | d       | e       |
+---------+---------+---------+---------+---------+
2

Run this field calculator expression on new field:

aDict={}
def COMBO(a,b,c):
 aKey=(a,b)
 if aKey in aDict:aDict[aKey]+=[c]
 else: aDict[aKey]=[c]
 return '|'.join(aDict[aKey])
#--------------
COMBO( !Field_1!, !Field_2!, !Field_3!)

enter image description here

To pick last record I used Dissolve tool on first two fields and statistics (last) on a new field:

enter image description here

Create additional fields in output and populate them using split function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.