Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Union or Join

hanswang09
6 - Meteoroid

Hi, 

I have a simple question to ask here. I can achieve the desired output but I am nor sure if  I am using the correct way. 

So, I want to "join" or "append" the following 2 input into the result format. I want to keep all customers but no duplicate customer IDs, using union function seems to be giving me this issue. The real data source will have multiple columns in each input. Don't know if that matters but just wanted to point out. 

I just want to ask what is the most effecient and smart way to achieve this. 

 

All helps appreciated. 

 

Input 1  Input 2  
      
Customer IDProduct 1 Customer IDProduct 2 
110 230 
220 311 
333 723 
621 843 
732 912 
      
      
Output      
      
Customer Product 1Product 2   
1100   
22030   
33311   
6210   
73223   
8043   
9012   
      
5 REPLIES 5
jdunkerley79
ACE Emeritus
ACE Emeritus

A combination of the two I think.

 

Join the inputs on CustomerID

Then Union all three output L/J/R from the Join together

 

 

Federica_FF
11 - Bolide

Hi!

 

Both of them!

 

Use a Join to have a Inner Join and the connect the 3 connectors of the join (R, L and J) to the Union tool to have a full outer join.

hanswang09
6 - Meteoroid

Hi, 

 

Thanks for reply. I tried this way but I got confused when I saw null customer IDs in some of the rows for the column Right_Customer ID. I guess it's because there are customers existing in input 2 but not input 1. But it seems like for the first customer ID column, it appears to be having all unique values. Just want to figure the bottom reason of it. 

 

Thanks

Federica_FF
11 - Bolide

That's happens because the Union after the Join is performing an union by Field name.

 

The ID column of the L and R input is called "Customer ID".

 

The ID columns of the Join are called "Customer ID" (left table) "Right_Customer ID" (right table).

 

So the L and R ID records are below the Customer ID column and you have the null value under the Right_Customer ID.

 

Cattura.PNG

hanswang09
6 - Meteoroid

Thank you very much for the explaination. I think that makes perfect sense. 

 

Thanks

Labels