Hello, can someone direct me towards a solution for counting the number of combinations in this kind of data? Expected output would be that 2 customers ordered Shoes and Pants, 1 customer odered Pants, Jeans and Shirts, etc.
Customer ID | Shoes | Pants | Jeans | Shirts |
321 | 1 | 1 | ||
123 | 1 | 1 | ||
456 | 1 | 1 | 1 | |
789 | 1 | 1 | ||
101112 | 1 | |||
678 | 1 | 1 | ||
543 | 1 | |||
021 | 1 | |||
555 | 1 | 1 | 1 |
Sample data attached.
Thanks,
Solved! Go to Solution.
Hi @mattlukoff, how about something like the attached?
It transposes, filters out nulls, sorts, before cross-tabbing and counting the occurrences.
What a fun question! Attached is my approach:
1) Pivot the data so it may be concatenated
2) Did a data cleanse to clean up the whitespace in the table (due to how I copied it into my workflow)
3) Found a named combo for each CustID by concat'ing the named of the purchased items together
4) Counted the combos in the dataset