Distinct after Concat in one cell

Level 2
Distinct after Concat in one cell


I'm trying to clear cells after concatenation : 

A,A,B,C,C,D --> A,B,C,D

A,A --> A

in a prepare recipe


Thanks in advance

0 Kudos
1 Reply
Level 3



You can use a Python function step in a Prepare recipe (see attached image). I have created a function that transforms each input (row cell from the column of interest) from unicode to string - this step might not be needed in your case, it depends on the format of your data. Then, the function splits each string on ',' and finally, gets the set of this list, turns it again into a list and joins its elements with ','.

I hope this helps!