10 Replies Latest reply on Oct 25, 2016 12:30 AM by Łukasz Majewski

# Can anyone help me to explain the Market basket Analysis?

Currently I am using a self-joining method to create a market basket analysis in Tableau. But I have a little bit difficult to interpret the results. For example, one result shows "Sub_category: A ; Sub_category: B; Number of records: 2000". How this 2000 is calculated?

I created a sample worksheet below.

 Order_product_id order_id customer_id sub_category 1 1 1 A 2 2 1 A 3 2 1 B 4 2 1 C 5 3 1 A 6 3 1 B 7 4 2 A 8 5 2 B 9 6 2 C 10 6 2 B 11 6 2 A 12 7 3 D 13 7 3 C 14 8 4 E 15 9 5 E 16 9 5 F 17 9 5 B 18 10 6 E 19 10 6 F 20 11 7 B 21 12 8 B 22 13 9 C 23 14 10 A 24 14 10 B 25 15 10 C

Based on the data above, we know the AB pairs occurs 4 times, but why in the Tableau, when it calculates, the number of records shows 11?

Can anyone help me to clarify my doubt? Thanks.

Warmest regards,

Bowen

• ###### 1. Re: Can anyone help me to explain the Market basket Analysis?

Hi Bowen,

Can you attach the sample workbook that you have created above????

-Ashish

• ###### 2. Re: Can anyone help me to explain the Market basket Analysis?

Hi,

I think you might not need to use self joins but it depends on what you need and how complex it is.

Here is used two simple table calculations for this purpose:

Łukasz

• ###### 3. Re: Can anyone help me to explain the Market basket Analysis?

Hi Ashish

Here it is.  I want to know by using two different ID as selfing join, how should we interpret the result? And what information we can get from those result? Thanks.

• ###### 4. Re: Can anyone help me to explain the Market basket Analysis?

Hi Łukasz,

Thanks for your reply. Can you explain to me the meaning of those two results? Thanks.

Regards,

Bowen

• ###### 6. Re: Can anyone help me to explain the Market basket Analysis?

Thanks

• ###### 7. Re: Can anyone help me to explain the Market basket Analysis?

Hi Bowen,

We basically use market basket analysis to know the buying behaviour of the customers. For eg. If company has a Shaving Razor as a product then does they also by products related to Razors like Shaving cream, Foam, Blades etc. Further you can detailed analysis for the preferences. If you have shaving cream and Shving foam. Question can be which one does customer like. Next level of analysis can be done is which flavour of the cream of foam is prefered by the customer? It can be Mint, Lime etc. You can also go for the analysis which product quantity is most prefered by customer. Eg. 50gms, 250 gms, 500gms etc. So it depends what exactly you want to know.

Baiscally they are looking at product groups which can be bundled together with the help of the analysis. (Trying to find the association between two products.)

Please find the below link. It has the marketbasket in the intermidiate section. You can downnload the solution for the same. Author has given his detailed comments in the caption section of chart which can really help you to understand better.

Let me know if that helps.

Thanks and Regards,

-Ashish Chaudhari

• ###### 8. Re: Can anyone help me to explain the Market basket Analysis?

You should always be ignoring the combinations of A-A, B-B. This can be achieved with the help of self join and category not equal to each other. its a good attempt. Try fixing the products with same association.

-Ashish

1 of 1 people found this helpful
• ###### 9. Re: Can anyone help me to explain the Market basket Analysis?

Thanks a lot.

• ###### 10. Re: Can anyone help me to explain the Market basket Analysis?

The table shows how many customers bought items in both categories or how many such orders there were. I think that's what you were looking for.