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

How to compare 2 rows and return the incorrect non matching fields

sumeet_rk
7 - Meteor

I need to compare 2 rows and return the columns which are not matching.

 

Basically , its a validation of rows from different datasets ,I will be joining the rows based on a common column ,
if there is any difference in the row values when it's compared with the other row , I will return the column which is not matching 

2 REPLIES 2
Hammad_Rashid
11 - Bolide

To compare two rows and identify the columns where the values differ in Alteryx, you can use the following approach:

  1. Join the two datasets based on a common column: Use the Join tool to merge the two datasets based on the common column.

  2. Use a Formula tool to compare each column: After the join, you can use a Formula tool to create new fields that indicate whether the values in the corresponding columns are the same or different.

  3. Filter the rows with differences: Finally, you can use a Filter tool to keep only the rows where differences were detected.

 

Here's a step-by-step guide:

 

Step 1: Join the Datasets

Use the Join tool to combine the two datasets based on a common column.

 

Step 2: Use a Formula Tool

Add a Formula tool to your workflow to create new fields that indicate whether the values in the corresponding columns are the same or different.

For each pair of columns you want to compare, you can create a new field with a formula like:

 

IF [Field1] = [Field2] THEN "Match" ELSE "Mismatch" ENDIF

 

Repeat this process for each pair of columns you want to compare.

 

Step 3: Filter the Rows with Differences

Use a Filter tool to keep only the rows where differences were detected. You can filter based on the newly created fields that indicate whether the values in the corresponding columns are the same or different.

 

gawa
16 - Nebula
16 - Nebula

hi @sumeet_rk 

When comparing the row, the best practice is to Transpose data into vertical shape, Join, and check difference by Filter tool.

As we are not sure of always having the same data schema in the most of real case, this method is generic solution to cater for such a scenario.

Please refer to the attached WF for reference and understanding what I meant to say.

image.png

Labels
Top Solution Authors