2 Replies Latest reply on Feb 4, 2014 7:44 AM by jonathan.richman.2

# calculate difference in multiple order dates

Trying to determine the average time it takes a customer to make a second purchase, a third purchase, etc., starting witht the first order (MIN[bill date field]).

• ###### 1. Re: calculate difference in multiple order dates

Vincent,

Here's a possibility.  I've attached a sample workbook and a diagram of the basic concepts involved.  Please let me know if you have any questions.  If you wanted to get the difference from the previous order instead of the difference from the first, you could replace First() with -1 in the calculation.

Regards,

Joshua

• ###### 2. Re: calculate difference in multiple order dates

This would work perfectly for me for something I'm trying to figure out. I'm almost there as I'm applying your logic to my issue. The only thing I can't figure out is what "First" is in the calculated field. My Difference in Days calculated field is NULL for everyone, so I'm thinking that I'm messing up the First part because I can't figure out what I'm doing wrong.

However, I'm guessing that First means that there is an existing day for an order for a given user and this is some standard Tableau syntax that symbolizes that. If that's the case, then I can't figure out why all my values are NULL.

Any additional insight would be great.

Thanks,

JR