Hi,
I have 2 lists of data.
1. List of customers' purchases
2. Full list of items
Customer | Item | Amount |
A | 123 | 1 |
A | 456 | 1 |
A | 789 | 1 |
B | 123 | 1 |
B | 456 | 1 |
C | 789 | 1 |
D | 456 | 1 |
D | 789 | 1 |
Item |
123 |
456 |
789 |
As you can see, customers don't purchase all items. How can I output the data to display each item across all customers such that items that aren't purchased display an amount of 0? Please note that I'm using the In-DB tools with data from SQL Server.
Expected result below with the new rows highlighted.
Customer | Item | Amount |
A | 123 | 1 |
A | 456 | 1 |
A | 789 | 1 |
B | 123 | 1 |
B | 456 | 1 |
B | 789 | 0 |
C | 123 | 0 |
C | 456 | 0 |
C | 789 | 1 |
D | 123 | 0 |
D | 456 | 1 |
D | 789 | 1 |
Thanks!
afk
Solved! Go to Solution.