Alteryx Designer Desktop Discussions

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

Duplicate Data removal

mmustkee
9 - Comet

Hi Team,

I have duplicate data in each row for example Sam/Sam coming twice and we "//" coming twice we need to have only one record but in case Sam/dam/Sam  "SAM" coming twice but not together then it should remain as it is. My result should only delete if something coming twice together.

I have also attached result in case you need to see. Please refer below:

DataResult Should Be
Sam/Dam/Dam/DanSam/Dam/Dan
Sam/Dam/Dan/DanSam/Dam/Dan
Sam/Sam/Dan/DanSam/Dan
Sam/Sam/Dan//DanSam/Dan
Dro/Bro/BroDro/Bro
Dro/Dro/sriDro/sri
KIN/Tin/Tin/Bin/SinKIN/Tin/Bin/Sin
KIN/Tin/Tin/Bin/Sin/SinKIN/Tin/Bin/Sin
KIN/Tin/Tin/Bin/Sin/Sin/kilKIN/Tin/Bin/Sin/kil
KIN/Tin/Tin/Bin/Sin/Sin/kil//KIN/Tin/Bin/Sin/kil
sin//bin/binsin//bin
dum//cumdum/cum
Clu/Clu/dlu/dluClu/dlu
Ene/Ene//she/heeEne/she/hee
Ene//tre/freEne/tre/fre
9 REPLIES 9
caltang
17 - Castor
17 - Castor

Something like this?

 

Screenshot 2023-07-14 131219.png

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
mmustkee
9 - Comet

Hi Caltang,

 

Thanks for your reply.

If you see record 17, we have original record is ( Dro/klo/sro/klo/dro) Where klo is not duplicate since it is not coming together. In the result it has removed second "klo" and result showing as (  Dro/klo/sro/dro) However result should be as ( Dro/klo/sro/klo/dro) 

Appreciate your help on this too. rest looks ok to me. I have millions of rows like this so there are chances of removing unnecessary data. Kindly generate both the column Original one and your result in final output so that it would be easy to compare.

 

Appreciate your help on this.

 

mmustkee
9 - Comet

@caltang 

Thanks for your reply.

If you see record 17, we have original record is ( Dro/klo/sro/klo/dro) Where klo is not duplicate since it is not coming together. In the result it has removed second "klo" and result showing as (  Dro/klo/sro/dro) However result should be as ( Dro/klo/sro/klo/dro) 

Appreciate your help on this too. rest looks ok to me. I have millions of rows like this so there are chances of removing unnecessary data. Kindly generate both the column Original one and your result in final output so that it would be easy to compare.

 

Appreciate your help on this.

caltang
17 - Castor
17 - Castor

Very well. Please find v2 then.

 

Screenshot 2023-07-14 140406.png

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
caltang
17 - Castor
17 - Castor

One more thing I'd like to recommend to you is before you run this workflow, convert your input into a YXDB file, then use the YXDB file as your input fo this workflow. It will help your workflow run faster.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
mmustkee
9 - Comet

@caltang 

You are superb.

flying008
14 - Magnetar

Hi, @mmustkee 

 

There is a easy way by formula for you :

 

 

Trim(Replace(REGEX_Replace([Data], '([[:alpha:]]+)\/{1,}\1(?=$|\/)', '$1'), '//','/'),'/')

 

录制_2023_07_14_14_42_02_863.gif

 

BTW, only a question, what mind of you want 'sin//bin/bin' to 'sin//bin' , but 'Ene//tre/fre' to 'Ene/tre/fre' ?

 

录制_2023_07_14_14_40_15_107.gif

mmustkee
9 - Comet

@flying008 

 

Ha! My bad on your question

It should result should with one "/" only so it should be "sin/bin"

Kindly share your workflow or can I use your formula in formula tool and it will work.

flying008
14 - Magnetar

Hi, @mmustkee 

 

So you can just put my expression in your formula to get your want. 

 

******

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

Labels