# Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
###### ALTER.NEXT:

Join us on Dec 2 for a half-day virtual analytics + data science event!
US & CA customers only

It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!
SOLVED

## How to compare two columns with each row of two columns.

Highlighted
8 - Asteroid
 C1 C2 new C1 A 1 0 B F B C H C D A D 1 8 0

From the above table. compare the C1 and C2 , if they are equal then particular compared value in C1 must be made 0. for example  In C1 I have A and in C2 I have A then  C1 contains A  made to 0.Is it doable in alteryx.

Highlighted
Alteryx Certified Partner

You would use a logic statement here. IF [C1] = [C2] THEN 0 ELSE [C1] ENDIF

Does this work for you? Maybe you can mockup a workflow to illustrate the issue

Andre

Highlighted
11 - Bolide

Yes, this can be done with a formula tool.  Depending on whether you want to overwrite your 'C1' column, it can look two ways.  See attached for more details.

Highlighted
8 - Asteroid

Thanks for the reply. But my issue is to compare every row of C1 with Every row of C2.From the table am comparing the all the values of C1 with all the values of C2.Then if C1 value exists in C2 then that same value which is equal should be 0 in C1.

Highlighted
11 - Bolide

It can be done but its much trickier.  Here is a way to approach it which is somewhat limited in that it will be very time consuming with a large data set, but will get the job done.  See attached for my attempt.

Highlighted
8 - Asteroid

Thank you very much!!!!!

Labels