top of page
Search
• Bernard K

# How many customers bought a certain combination of products?

This is a common question in retail industry - when one is interested to know how many customers ordered certain items together.

### Let’s build a case.

(The above sample data contains four columns – i.e., Id, Order Id, Customer Name and Product. Order Id represents each order by customers – with some of the orders containing several products).

(You can populate similar data to follow along)

### The problem

In this case, using data in the above snapshot, lets find the customers who ordered a ‘Chair’ and a ‘Table’ at the same time.

### The Solution

First let’s create a calculation that will return ‘Chair’ and ‘Table’ while bundling the rest of products as nulls.

Next, let’s create a calculation that returns true for orders containing two unique products (i.e., Chair & Table) while returning False for order containing one or zero unique products.

Add the above calculation as a filter and select ‘TRUE’.

For this case, the above calculation has been used as a filter in the following view.

We can therefore say, for this sample data. Three customers namely, James Kilo, Keith and Kelly ordered a Chair and a Table together.

I hope this was helpful to you.