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
Solved! Go to Solution.
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
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.
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 ?
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
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
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
@Kaish
find the workflow attached
mark done if solved.
Hi @shancmiralles I was able to find my solution through Regex formula which was very useful, thanks buddy
Hi @Raj thanks for your flow, it worked great for me, both your solution and the Regex solution worked great for me. Thanks Buddy