3 Replies Latest reply on Dec 10, 2012 12:23 PM by Jonathan Drummey

# Count of orders by customer

I have the fields:

order_id

customer_id

order_date

order_total

I want to create a table that shows for some given month

# customers who bought 1x

# customers who bought 2x

# customers who bought 3x

# customers who bought 4x or more

I originally tried this:

COUNTD(order_id) > 2

But it gave me a true false calculation rather than a segment I can use. Any help would be great!

Thanks,

Jeff

• ###### 1. Re: Count of orders by customer

Is this what you were looking for? The attached example uses the Superstore Sales sample data with two custom calculations - one to effectively assign each batch of orders to a custom bin (using an IF/THEN statement), the second a table calculation to calculate how many customers fell into the bin.

• ###### 2. Re: Count of orders by customer

Jonathan,

I believe the table calc in the sample needs to use compute by Cell instead of Table-Across to get the number of customers.

• ###### 3. Re: Count of orders by customer

Nice catch, Patrick! I was still learning table calcs then. Actually, I'm still learning table calcs, only I know a bit more now. The Compute Using Cell works, however it is drawing 5100 marks by creating stacked bars, on per Customer. I've added an optimized view that only draws one mark per bar, that uses a Compute Using of Customer.

Jonathan