Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everyone,
I want to make a pivot table with the orderID and specific ProductName plus a column in which i can see which other products the customers are buying in combination. For example
| OrderID | ProductName | Products ppl also order with cola |
|---|---|---|
| 1 | Cola | Chips |
| Biscuits | ||
| 2 | Cola | nuggets |
| Chips | ||
| 3 | Cola | ice cream |
| Chips | ||
| nuggets |
i have tried the wildmatch thing for selecting the specific ProductName but how I can get the products in combination the people are buying.
One OrderID contains more than 1 product.
my result should look like this:
| ProductName | ProductName2 | Count |
|---|---|---|
| Cola | Chips | 3 |
| Cola | Ice Cream | 1 |
| Cola | nuggets | 2 |
So that i can see the products which are selling more with Cola as you can see from the table above Chips is top seller.
Regards
Maybe like attached?
ORDERS:
LOAD * INLINE [
OrderID, ProductName
1, Cola
1,Chips
1, Biscuits
2, Cola,
2, nuggets
2, Chips
3, Cola,
3, ice cream
3, Cola
3, Chips
3, nuggets
];
LOAD OrderID, ProductName as PN2 Resident ORDERS;
Pivot table with dimensions ProductName and PN2 (you can re-label PN2 to ProductName in the chart if you want) and as expression:
=count(Distinct if(ProductName<>PN2, OrderID))
Hope this helps,
Stefan