Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have gone thorugh many of discussion and articles about Market Basket Analysis. (MBA)
all of them explans about how get MBA data for a seleted item or product.
However, I need to generate a full list that contains all items (about 200K SKUs) and 5 items next to it that shows highest co-occurence.
Can any one please give me a tip for this?
thanks in advance.
For below data, I need to generate the list that contains all Prod code, Associated Prod Code and frequency of Co-occurence.
LOAD * INLINE [
Customer, InvoiceNo, Prod
260690, 1, Tea
260690, 1, Tea
260690, 1, Fruit
260690, 1, Fruit
260690, 1, Fish
260690, 1, Fish
260690, 2, Tea
260690, 2, Tea
260690, 2, Fruit
260690, 2, Fruit
260690, 2, Fish
260690, 1, Corn
260690, 1, Corn
260690, 1, Fruit
260690, 1, Fruit
260690, 1, Tea
260690, 1, Tea
260690, 3, Corn
260690, 3, Corn
260690, 3, Fruit
260690, 3, Fruit
260690, 3, Fish
260690, 3, Fish
260690, 1, egg
260690, 1, egg
260690, 1, egg
221729, 3, Tea
221729, 3, Tea
221729, 3, Tea
221729, 3, Tea
221729, 3, Tea
221729, 3, Tea
3898439, 4, egg
3898439, 4, Fruit
3898439, 5, egg
3898439, 5, Fruit
];
Hi
I think there is some problem in your data as each record is repeated twice.
Now answering to your mail answer - You need to make buckets of all possible combinations of Items & then check those into each invoice if combination is there in order.
[* Technical Hint: Assigning number to each item & use of loops will help to achieve this]
The top 5 count of these buckets will give your desired Market Basket Analysis.
Hope this will be helpful for you.
--
Regards,
Prashant P Baste
Try to share your sample qvw. See:
QlikCommunity Tip: How to get answers to your post?
Preparing examples for Upload - Reduction and Data Scrambling
please see amended question.
thanks so much for your kind comment.
Hi John,
What do you mean by co-occurrence in this context, share the expected output so that we can help you.
Regards,
Navdeep
Like in attached sample qvw?
Hi
I think there is some problem in your data as each record is repeated twice.
Now answering to your mail answer - You need to make buckets of all possible combinations of Items & then check those into each invoice if combination is there in order.
[* Technical Hint: Assigning number to each item & use of loops will help to achieve this]
The top 5 count of these buckets will give your desired Market Basket Analysis.
Hope this will be helpful for you.
--
Regards,
Prashant P Baste
Hi John,
can You provide, at least, the expected result ?
Perhaps, like this
Regards,
Antonio
Problem solved.
THanks all for your valuable inputs.
Product | Associate_product | Co_Occurunce ( In same invoice) |
egg | Corn | 1 |
Corn | Corn | 2 |
Fish | Corn | 2 |
Fruit | Corn | 2 |
Tea | Corn | 2 |
Corn | egg | 1 |
Fish | egg | 1 |
Tea | egg | 1 |
egg | egg | 3 |
Fruit | egg | 3 |
egg | Fish | 1 |
Corn | Fish | 2 |
Fish | Fish | 3 |
Fruit | Fish | 3 |
Tea | Fish | 3 |
Corn | Fruit | 2 |
egg | Fruit | 3 |
Fish | Fruit | 3 |
Tea | Fruit | 3 |
Fruit | Fruit | 5 |
egg | Tea | 1 |
Corn | Tea | 2 |
Fish | Tea | 3 |
Fruit | Tea | 3 |
Tea | Tea | 3 |