Removing Duplicate Values from rows
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Labels:
- Help
- Input
- Output
- Preparation
- Regex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Kaish
find the workflow attached
mark done if solved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @shancmiralles I was able to find my solution through Regex formula which was very useful, thanks buddy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Raj thanks for your flow, it worked great for me, both your solution and the Regex solution worked great for me. Thanks Buddy