7 Replies Latest reply on Mar 9, 2012 8:16 PM by Shawn Wallwork

# Determining basket size of customers

Hi,

I'm looking to create a measure which is effectively the basket size of a customer, which can then be used for subsequent analysis.

Specifically, from the attached Tableau file, I'd like to create a measure that calculates the basket size of each customer, and then create a histogram out of it with number of customers on the y-axis, and buckets of basket size (1, 2, 3 etc) - the ultimate question I'd like to answer is what is most common basket size for my customers in different cities. Unfortunately doing a simple number-of-records / customers isn't going to work, because that just averages across the population.

Thanks!

Kevin

• ###### 1. Re: Determining basket size of customers

What do you mean by basket size? I guess you probably mean total items per customer across all products - but it's not obvious from the question or the sample data.

• ###### 2. Re: Determining basket size of customers

Hi Richard,

Thanks - yes, sorry for the lack of clarity - the sample I uploaded was a bit faulty!

What I'm looking for is, for example, you can see that customer KBJ0324583 (in the new twbx file) has purchased 2 different products, and 16 items in total, while customer KBJ0324592 has purchased only 1 unique product, 2 times.

Let me know if that makes more sense!

Kevin

• ###### 3. Re: Determining basket size of customers

Hi Kevin, just to be clear you said:

the ultimate question I'd like to answer is what is most common basket size for my customers in different cities.

So in the pix below your most common basket size in Berlin is 2, right?

What's your most common basket size in, say London or Chicago? Or are you just want to rank them.

--Shawn

• ###### 4. Re: Determining basket size of customers

Hi Shawn,

Thanks for your questions - I'm sorry I've been so unclear!

What I envisage is to create a histogram of sorts, with number of customers on the y-axis, and buckets for number of unique products on the x-axis (nb, not number of total items). Hope this makes things a bit clearer!

Kevin

• ###### 5. Re: Determining basket size of customers

Kevin, either the attached workbook and the pix below is close to what you're looking for, or I'm completely lost! Note, I wasn't sure if you wanted use COUNTD() or COUNT of customers. You can change it in the 'Number of Customers' calculated field. Also the item bin size is set to 1 so it will show all the different basket sizes that are within each market.

Hope this is what you were looking for.

--Shawn

• ###### 6. Re: Determining basket size of customers

Hi Shawn,

Thanks - hadn't realised that it was as straightforward as you demonstrated!

Kevin

• ###### 7. Re: Determining basket size of customers

Whew! Glad it worked for you Kevin.

--Shawn