Hi
Im doing a task where I need to concatanate values. Afterwards I need to take only unique values within that cell.
Is there a simple way to do this? Without having to split them all into rows and group on them.
Solved! Go to Solution.
Hey @Hamder83, is there any reason you need to get the unique values after the concatenation, rather than before, like so?
@Hamder83, you can give this a try in case you are looking to remove the duplicates after concatenation.
Thanks!
@grazitti_sapna would you mind to break down the regex formula for me?
Thank you very much, this is esactly that I needed :)
@Hamder83, sure.
\b(\w+,?),= Match an identifier and a comma.
(?=.*\b\1): Then check whether you can match the same identifier, somewhere ahead in the string.
What this regex does is it checks the first occurrence of the word then match the same identifier ahead of that word and replaces the first value with the blank as per regex_replace done in my post above.
I took reference from here- https://stackoverflow.com/questions/3309805/what-regular-expression-can-remove-duplicate-items-from-...
I hope this helps!
Thanks!