Inspire EMEA 2022 On-Demand is live! Watch now, and be sure to save the date for Inspire 2023 in Las Vegas next May.
Announcement | We'll be doing maintenance between 2-3 hours, which may impact your experience. Thanks for your patience as we work on improving the community!

Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer and Intelligence Suite.
SOLVED

Unique values within cell?

Hamder83
11 - Bolide

Hi 

Im doing a task where I need to concatanate values. Afterwards I need to take only unique values within that cell.

 

Hamder83_0-1659080822391.png

 

Hamder83_1-1659080830531.png



Is there a simple way to do this? Without having to split them all into rows and group on them.

 

4 REPLIES 4
DataNath
16 - Nebula

Hey @Hamder83, is there any reason you need to get the unique values after the concatenation, rather than before, like so?

DataNath_0-1659081283012.png

grazitti_sapna
17 - Castor

@Hamder83, you can give this a try in case you are looking to remove the duplicates after concatenation.

grazitti_sapna_0-1659082149324.png

 

Thanks!

Sapna Gupta
Hamder83
11 - Bolide

@grazitti_sapna  would you mind to break down the regex formula for me?

Thank you very much, this is esactly that I needed :) 

grazitti_sapna
17 - Castor

@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!

Sapna Gupta
Labels