I wrote previously a post on how to count customers who bought both A and B. Today someone asked how to count those who all bought the same N items. N>=2. He specifically requires a multiple choice filter so that people can select some items and only those who bought them all are showing. (All right, the problem is paraphrased.)

In the previous post, the purpose is to map out the tallies for all possible pairs of products and to study the correlation between products. Here we only need to show the customers who bought one set of products.

We will use the Superstore data set as an example. In the data set, there are 17 subcategories. We will show how to list or count the customers who bought the same set of subcategories of products.

The main steps are as follows:
1.Right click the Sub Category filter and make it a context filter.
Only those who bought any one of the sub categories are kept using this filter.
2.Show Sub Category filter and select only 2 of the sub categories. (You can select more after step 4.)
3.Apply the following filter:
This filter will only keep those who bought exactly the same set of selected subcategories.

4.Select True when prompted. If you don't see True, do these:
- Show filter
- Click the drop down menu of the filter
- Select "All values in context"
Caveat: don't select too many subcategories in the same time. Otherwise, you might see a blank screen because no one bought all sub categories of products. Start by selecting any 2 sub categories.

Last, this LOD formula will give us the number of total customers who bought the same products.
You can play with and download the interactive workbook here.

8

View comments

  1. This technique converts the multiple choice filter from "A or B or C" to "A and B and C" filter.

    ReplyDelete
  2. Hi, thanks for sharing.

    Since it works on a LOD calculation , if I want to check the number of customers who purchased in a particular time interval (for eg. only last month) , how can I do it?

    ReplyDelete
    Replies
    1. Create a context filter using the date dimension. That should do it.

      Delete
  3. How to I count when specific products are purchased together from a massive list of products? (ie, without specifying the sub categories)

    ReplyDelete
    Replies
    1. define your granularity. product level is good too if that's what you like to measure. you can create subcategory artificially, then sub-categorize the products and compare at the subcategory level.

      Delete

(Refresh the page if you want to view the gif image multiple times. Or go to Tableau Public and click the button at the top-right corner.)

Jake and I collaborated on a dashboard. He told me that he learnt a way to create an in-place help page in Tableau. He first saw it at a conference somewhere and couldn't recall who the speaker was. So I am blogging here about it but the credit goes to somebody else. If anyone knows who the original creator is, leave a comment below.

The key idea is to float a semi transparent worksheet on top of the dashboard, where a help text box is strategically placed on top of each chart. This way, we can explain how to view each chart and what data points are important, etc. This worksheet is collapsible by a show/hide button. 

Below I would like to show how this worksheet can be constructed.

1. Sheet with a single data mark.

  • Double click the empty space in Marks panel and add two single quotes. Make the null pill a text label. This creates a single null mark.
  • Set the view as "Entire View"

2. Create an show/hide button

  • Go to the target dashboard
  • Drag a floating vertical container to the dashboard, making it cover all the area of interest.
  • Drag the Single Null Mark sheet and drop it into the above container. Hide the sheet title.
  • Create an open/close button for the container and place the button at the top-right corner.

3. Add annotations

  • Format the sheet background opacity as 70% in the layout manager             
  • Select area annotations and place them anywhere of interest. 
  • Write help text and format it to highlight important messages.  
  • The text can serve as functional guide and/or insight guide.

Here is an example. Feel free to download the workbook and explore. Click the "i" button at the top-right corner to view the in-place help. 

0

Add a comment

Blog Archive
Loading
Dynamic Views theme. Powered by Blogger. Report Abuse.