Tagged with basket-analysis - Visokio Forums http://forums.visokio.com/discussions/tagged/basket-analysis/feed.rss Mon, 30 Oct 17 21:46:03 -0400 Tagged with basket-analysis - Visokio Forums en-CA Basket Analysis: finding category overlaps http://forums.visokio.com/discussion/1960/basket-analysis-finding-category-overlaps Fri, 21 Dec 2012 07:12:12 -0500 tgcrouch 1960@/discussions I have data at transactional level, where several transactions can form a single invoice. Assuming one invoice has 3 transactions with a different 'product group' (out of perhaps 10 available product groups), I would like to understand how many invoices contain which combinations of product groups. e.g.

invoice 1
trx1 - 3 apples = FRUIT product group
trx2 - 2 twix bars = SNACK product group

invoice 2
trx1 - 1 orange = FRUIT product group
trx2 - 1 newspaper = NEWSPAPER product group

invoice 3
trx1 - 1 apple = FRUIT product group
trx 2 - 3 mars bars = SNACK product group
trx 3 - 2 oranges = FRUIT product group

I would like to count how many invoices have both FRUIT and SNACK product groups, in this case the overlap should equal 2 (because invoices 1 and 3 have this combination). So far, I have managed to get the number of invoices for each of the product groups separately, but with no overlap between any of them (just 0 values).

Aggregation at invoice level doesn't seem to change anything.
Any ideas?
Thanks in advance!]]>