Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.

Alteryx Designer Desktop Discussions

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

Compare each caracters from two columns

Brunoml
5 - Atom

Hello,

 

I have a problem : I Need to compare each caracter into a column A with each caracter of the column B :

 

Example : 

ABResult
1,21,2OK
2,11,2OK
1,31,2,3OK
1,41,2,3NOK

 

Can you help me please ?

 

Best Regards,

Bruno

2 REPLIES 2
NicoleJohnson
ACE Emeritus
ACE Emeritus

Hi!

Try this formula for the Result column:

 

If ReplaceChar(ReplaceChar([A],",",""),ReplaceChar([B],",","||"),"")="" Then "OK" Else "NOK" Endif

 

What this will do is compare field A (without any commas) to field B (replacing any commas with the double-pipe || "OR" operator), and if a match is found in A for any of the characters in B, it will replace that character in A with a blank. If there is anything leftover after comparing to all the options in B, then the Result will be "NOK".

 

Does this accomplish what you're looking for? :)

 

NJ

Brunoml
5 - Atom

Hello,

 

It's perfect thank you !! :)

 

Have a good day!!

 

Kind regards,

Bruno

Labels