Missed the Q4 Fall Release Product Update? Watch the on-demand webinar for more info on the latest in Designer 24.2, Auto Insights Magic Reports, and more!
Free Trial

Alteryx Designer Desktop Discussions

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

Remove duplicated string when duplicate follows immediately.

jsatt
5 - Atom

Sorry if the subject is confusing. I currently have a field that looks like this.   "SHV-IAH-IAH-CUN-CUN-IAH-IAH-SHV"   I need to be able to delete only the consecutive duplicates so it would look like this.  "SHV-IAH-CUN-IAH-SHV". Thank you.

3 REPLIES 3
chandler-gjino
Alteryx
Alteryx

attaching a solution.
I parsed the string using text to columns and "-" as the delimiter
afterwards, I used the multi-row formula tool to null any duplicates
I filtered out the now null duplicates, then resorted just in case, to ensure the same order
then used the summarize tool to concatenate back togetherremove duplicates.png
hopefully this helps! 

 

 

jsatt
5 - Atom

Chandler, thank you for this. This works for my example. Unfortunately I need to run this on a large dataset so this exact workflow may not work. However, I think your Multirow formula tool will send me down the right path. I really appreciate the quick help!

flying008
15 - Aurora

Hi, @jsatt  @chandler-gjino 

 

If you can use regex to formula , the case will be so easy.

[ Perhaps you need show more form cases for compatibility .]

 

 

Spoiler
REGEX_Replace([Txt], '([[:alpha:]]+)-\1', '$1')

 

录制_2023_09_12_08_06_31_611.gif

 

******

If can help you get your want, please mark it as a solution and give a like for more share.

Labels
Top Solution Authors