Alert: There is a planned Community maintenance outage October 16th from approximately 10 - 11 PM PST. During this time the Alteryx Community will be inaccessible. Thank you for your understanding!

Alteryx Designer Desktop Discussions

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

Comparison of two tables - Question

Thanks4YourHelp
5 - Atom

Hello, 

 

I need to compare two tables that have a common column, "Old Record ID." They have the same columns, and share some values, but each table contains unique values that I want to highlight. The tables can be joined across Old Record ID. Old Record ID and New Record ID have a 1:1 relationship. There are multiple groups, and each group has multiple values.

 

I want the output to have 8 columns, with all of the columns from each table. If there are any rows that are exactly the same, I'd like to combine them in the output. If one table contains values that the other table does not contain, I'd like to leave the values blank. I tried using a join tool, but it kept spitting out too many rows for some reason. Thank you!

 

Please see example below: 

 

Table 1

(T1) New Record ID(T1) Group(T1) Value(T1) Old Record ID
UN1Group1YUnique1
UN1Group1XUnique1
UN1Group1ZUnique1
UN2Group1ZUnique2
UN2Group2AUnique2
UN2Group3MUnique2
UN2Group3NUnique2
UN3Group1YUnique3
UN4Group1ZUnique4
UN4Group3PUnique4

 

Table 2:

(T2) New Record ID(T2) Group(T2) Value(T2) Old Record ID
UN1Group1YUnique1
UN1Group1ZUnique1
UN1Group2AUnique1
UN2Group1ZUnique2
UN2Group2AUnique2
UN2Group3MUnique2
UN2Group3NUnique2

 

Desired output -- Comparison of Table 1 and Table 2:

(T1) New Record ID(T2) New Record ID(T1) Name(T2) Name(T1) Value(T2) Value(T1) Old Record ID(T2) Old Record ID
UN1 Group1 X Unique1 
UN1UN1Group1Group1YYUnique1Unique1
UN1UN1Group1Group1ZZUnique1Unique1
 UN1 Group2 A Unique1
UN2UN2Group1Group1ZZUnique2Unique2
UN2UN2Group2Group2AAUnique2Unique2
UN2UN2Group3Group3MMUnique2Unique2
UN2UN2Group3Group3NNUnique2Unique2
UN3 Group1 Y Unique3 
UN4 Group1 Z Unique4 
UN4 Group3 P Unique4 
1 REPLY 1
grazitti_sapna
17 - Castor

@Thanks4YourHelp , Based on your desired output you will have to outer join the data on the basis of OldRecordID, Group and Value fields as below:

grazitti_sapna_0-1668150666210.png

 

 

Sapna Gupta
Labels