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 ID | Product 1 | | Customer ID | Product 2 | |
| 1 | 10 | | 2 | 30 | |
| 2 | 20 | | 3 | 11 | |
| 3 | 33 | | 7 | 23 | |
| 6 | 21 | | 8 | 43 | |
| 7 | 32 | | 9 | 12 | |
| | | | | | |
| | | | | | |
| Output | | | | | |
| | | | | | |
| Customer | Product 1 | Product 2 | | | |
| 1 | 10 | 0 | | | |
| 2 | 20 | 30 | | | |
| 3 | 33 | 11 | | | |
| 6 | 21 | 0 | | | |
| 7 | 32 | 23 | | | |
| 8 | 0 | 43 | | | |
| 9 | 0 | 12 | | | |
| | | | | | |