Alteryx Designer Desktop Discussions

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

To find matches between two columns - if column 1 is contained within column 2

Lauren_Holmes
8 - Asteroid

Hello,

I need some help with how to find "Matches" and "No Matches" between two fields. 

I have been using the "if contains" formula however this is not giving me the desired output.

 

Example below:

Column 1 and 2 show what the inputs are, and column 3 is what the desired output should show. However the last column is showing what the current if contains statement is showing. 

 

COLUMN 1COLUMN 2MATCH?CURRENT IF STATEMENT RETURNS:
NONENONE1MATCH NO MATCH
1220893712208937AMATCHNO MATCH
UNKNOWNUNKNOWN71MATCHNO MATCH
21700000170201170201NO MATCHMATCH 

 

I am really not sure if this is possible. I have a number of columns containing "NONE" or "UNKNOWN" and with this the 1/71 at the end shows the number of times this "unknown" is used. This needs to remain however needs to be shown as a "match".

 

Any advice would be appreciated!

3 REPLIES 3
Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @Lauren_Holmes,

 

I think perhaps you have the conditions reversed in the Contains() function?

 

In the Contains function we have a "string" and "target". The string is the field we're looking for the target value in. Therefore in your case the string field is Column2 and target field is Column1.

 

IF Contains([COLUMN 2], [COLUMN 1])
THEN 'MATCH'
ELSE 'NO MATCH'
ENDIF

 

Jonathan-Sherman_0-1621511288297.png

 

 

I've attached my workflow for you to download if needed!

 

Kind regards,

Jonathan

Lauren_Holmes
8 - Asteroid

One day my brain will start working! Why I didn't try this before, thank you for letting me know! 🙂

Jonathan-Sherman
15 - Aurora
15 - Aurora

No problem at all! 🙂

Labels