Advent of Code is now back for a limited time only! Complete as many challenges as you can to earn those badges you may have missed in December. Learn more about how to participate here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Compare two fields and identify what the differences are

CPAul
7 - Meteor

 

I have two fields that I know do not match. Is there a formula or regex that can identify what the different characters are between the two fields? For example:

Input #1Input#2Formula/Regex Output
ABCDEBCDAE
CDEABABCDE
ABCABC 
BCDABCDEAE

 

Thanks in advance!

 

Paul

2 REPLIES 2
apathetichell
19 - Altair

Follow these instructions:

1) RecordID

2) regex (tokenize mode) - split to rows. in your token put a single . - do this for column 1.

3) connect a second regex tool to your RecordID - repeat what you did for column 1 - but do it for column2.

4) Join. Join on Record ID - and whatever you're token  name is.

5) do you see your left and right anchors from your join output? those are unmatched. Add them to a union tool.

6) Attach a summarize tool. group by recordID - your Regex field - set that in Concatenate mode with no delimiter.

 

try this yourself and post if you are having issues. 

 

DataNath
17 - Castor
17 - Castor

Would definitely recommend @apathetichell's approach if you want something that is more 'reader friendly' to others picking up the workflow etc as that will create an easy-to-follow flow/process. There is an alternative way as follows though, whereby we use each of the 2 fields as a lookup group of characters to replace any of those found in the other field with '' i.e. nothing. Doing this both ways round creates a list of characters that aren't common across the 2 fields:

 

DataNath_0-1679426033406.png

Labels
Top Solution Authors