9 Replies Latest reply on Dec 1, 2016 10:55 AM by Megha Chhabra

# Calculating the count of purchases made by a customer on the first purchase date

Hi,

I want to calculate the distinct number of product bought buy a customer on his forst day of purchase.

I tried putting the min[date] in row field and countd[productcode] in column but it is giving me the count of all products for that user not for that particular first day.

Kindly help!

• ###### 1. Re: Calculating the count of purchases made by a customer on the first purchase date

Best to do this step by step so you understand what's happening.

First you want to isolate the first day of purchase for each customer. I'm going to make up field names but it should be obvious. {FIXED [Customer]:MIN([OrderDate])}

Next return the products bought on that day:

IF [OrderDate] = {FIXED [Customer]:MIN([OrderDate])} THEN [Product] END

You're then able to to a distinct count on that field.

• ###### 2. Re: Calculating the count of purchases made by a customer on the first purchase date

Hi Andrew,

This is still not giving me the count of product bought on first date.

I created one calculated field as first date: {FIXED [Customer]:MIN([OrderDate])}

and second as IF [OrderDate] = {FIXED [Customer]:MIN([OrderDate])} THEN [Product] END

I dragged one into the columns and added the other as a count field in row. It is still not giving me the correct data.

Kindly help

• ###### 3. Re: Calculating the count of purchases made by a customer on the first purchase date

Hi Megha.

Can you post a packaged workbook? It's hard to see where the problem lies without looking at the data.

Thanks,

Nachiket

• ###### 4. Re: Calculating the count of purchases made by a customer on the first purchase date

Thank you so much guys.

It worked !

• ###### 5. Re: Calculating the count of purchases made by a customer on the first purchase date

Hi ,

I was able to compute the count on first day, but I having another issue. Please share your thoughts on this.

If I put the filter for month May, it still shows me my original first purchase date ( i.e. Jan).

What to do if i need to see the data of first purchase data for a particular month ?

Thanks !

• ###### 6. Re: Calculating the count of purchases made by a customer on the first purchase date

Hello Megha,

I've recreated it without LOD's.

Let me know if it helps.

Regards,

Sudhakar Reddy

• ###### 7. Re: Calculating the count of purchases made by a customer on the first purchase date

Add your month filter to context (click the drop down arrow on the month pill on the filters shelf to do this)