6 Replies Latest reply on Nov 3, 2015 4:07 AM by Chris McClellan

# Calculate Period since last order in the current month

Hi,

I need to calculate the no of days since a customer last ordered from us.

I have the following calculated fields:

1st Order Date-{Fixed Customername : MIN(order  date)}

Last Order Date-{ Fixed Customername : MAX(order  date)}

But I want to know how long it has been since a customer last ordered in a certain month e.g. in September 2015 how many customers had not ordered for 30 days and so forth.

• ###### 1. Re: Calculate Period since last order in the current month

If you have a time dimension with all the months in it, you'd just create a calculated field like this :

datediff('day', [Last Order Date], [Time Dimension])

That should show you the right result, but if it doesn't can you supply some sample data or workbook ?

• ###### 2. Re: Calculate Period since last order in the current month

Chris,

Is time dimension a calculated field? Maybe you can give me an example

• ###### 3. Re: Calculate Period since last order in the current month

Hi Chris,

I have attached the workbook.

• ###### 4. Re: Calculate Period since last order in the current month

Hopefully this helps

• ###### 5. Re: Calculate Period since last order in the current month

Thanks I think this will work.

• ###### 6. Re: Calculate Period since last order in the current month

Don't forget to mark the answer as correct if it works