We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Compare two columns with delimiters and find the difference

Timetolearn
5 - Atom

I am new to Alteryx and would really appreciate the help

 

My input next is as below. I need to subtract the text of Column B from Column A and give the output as the difference 

 

IDAB
8521B1,B2,B3,C1A,C1B,C2,C3,D1,D2,D3,J3,J4,J5,J6,J7,J8,J9,JA,JB,B4,C4,D4,G4,K3,K4,K5,G1,G2,G3A,G3BA1,A2,A3,B1,B2,B3,C1A,C1B,C2,C3,D1,D2,D3,J0,J1,J2,J3,J4,J5,J6,J7,J8,J9,JA,JB,A4A,A4B,B4,C4,D4,G4,K3,K4,K5,G1,G2,G3A,G3B
8535B1,B2,B3,C1A,C1B,C2,C3,D1,D2,D3,J3,J4,J5,J6,J7,J8,J9,JA,JB,B4,C4,D4,G4,K3,K4,K5,G1,G2,G3A,G3BA1,A2,A3,B1,B2,B3,C1A,C1B,C2,C3,D1,D2,D3,J0,J1,J2,J3,J4,J5,J6,J7,J8,J9,JA,JB,A4A,A4B,B4,C4,D4,G4,K3,K4,K5,G1,G2,G3A,G3B
1 REPLY 1
DataNath
17 - Castor
17 - Castor

Hey @Timetolearn, here's one way I'd look at doing this. The steps can basically be described as follows:

 

1) We split fields A and B into rows, each time a comma occurs. This creates one row per ID per value.

2) We then conduct a join on ID = ID and A = B.

- Where A != B, this means there is no match found within that ID and is hence a difference

3) These non-matches fall out of the L and R output anchor of the Join tool which represents the left/right side of the join.

4) We then sort and concatenate the values that fall out of said anchors, in order to get a list of the differences between the 2 original fields.

 

Hope this helps! Workflow attached.

Labels
Top Solution Authors