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
Solved! Go to Solution.
To compare two rows and identify the columns where the values differ in Alteryx, you can use the following approach:
Join the two datasets based on a common column: Use the Join tool to merge the two datasets based on the common column.
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.
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.
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.