Alteryx Designer Desktop Discussions

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

Removing Duplicate Values from rows

Kaish
8 - Asteroid

I have a data set in which after concatenating my data I have few Values which are duplicated I want to remove only those duplicate values, the rest of the data will remain as it is like the "comma" will be present if there are unique values beside each other.

 

Input  Example -  A         B

                            1        802,802,903

                            2        903,709

                            3        654

                            4        802,789,802,789,903

Output Example - 

                            A           B 

                            1         802,903 

                            2         903,709 

                            3         654

                            4         802,789,903

 

Kindly help me to find the output. Thanks

7 REPLIES 7
ChrisTX
15 - Aurora

Is the concatenation done in Alteryx using a Summarize tool?  Before the Summarize, add another Summarize tool and Group By field A and field B.  This will remove the duplicates before the concatenate, easier than trying to remove them after.

 

Chris

OTrieger
8 - Asteroid

Hi @Kaish 

I think that it will be easier if you do it before the concatenation. You still can do it post concatenating however try to investigate if you can do it prior to it.

Kaish
8 - Asteroid

Hi Chris actually I want the output in the same row, I can't have another value below the existing data, if the data has "comma" that is how I want the output. Can you help me in this ?

 

ChrisTX
15 - Aurora

Can you post a sample workflow?  It's not easy to understand what you mean by "I want the output in the same row".  A sample workflow would help clarify the issue you're trying to solve.

 

Chris

shancmiralles
9 - Comet

hi! @Kaish 

 use a formula tool.. create a new output column.. then use this formula:
regex_replace([field],"\b(\w+),(?=.*\b\1,?)","")

the [field] is your b column where the concatenated data  is!

hope this helps! 
and please mark this as a solution if it really help <3

shancmiralles
9 - Comet

hey @Kaish  im actually having fun with your case :)

another way for you to do this using 3 tools :

pull in your "text to columns"  configuration is:
column to split: B
Delimiters: , (comma)

"SPLIT TO ROWS" (2ND OPTION)

you should have 2 fields now (A and B)

Next we use the "UNIQUE TOOL" and select both columns (A and B).

Last Tool to use is the "Summarize" tool, Configuration is:

A = Group By (rename as "A")
B= Concatenate (rename as "B")

a solution provided by my mentor  @mikemc1979  

Raj
16 - Nebula

@Kaish 
find the workflow attached 
mark done if solved.

Labels