Select to view content in your preferred language

Simplify concatenated values

284
1
Jump to solution
07-18-2024 02:00 PM
PabloOliver
New Contributor

hello,

I am concatenating values in a Dissolve tool in a model. The concatenated values are appear correctly in the final result, however, there are multiple instances of the same value in the result. I'm looking for a way to simplify the result so that only one instance of each unique value appear in the final result.

any ideas?

 

thanks

PO

 

 

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

you could do a separate field calculation

 

row = 'c, d, a, b, c, e, a, c'

",".join(sorted(set([i.strip() for i in row.split(",")])))
'a,b,c,d,e'

 


... sort of retired...

View solution in original post

1 Reply
DanPatterson
MVP Esteemed Contributor

you could do a separate field calculation

 

row = 'c, d, a, b, c, e, a, c'

",".join(sorted(set([i.strip() for i in row.split(",")])))
'a,b,c,d,e'

 


... sort of retired...