3 Replies Latest reply on Jul 1, 2016 5:54 AM by Josef Freedman

    How To Calculate days since previous Order

    Josef Freedman



      I'm attempted to calculate days since previous order.


      I have days since first order, and says since last order using:


      Min Order Date: {Fixed email : MIN([order  date])}

      Max Order Date: { Fixed email : MAX([order  date])}


      I would like to find days since previous order for each order.




      order 1: 01/01/2015 Days since previous order = null (or zero)

      order 2: 02/01/2015 Days since previous order = 1

      order 3: 07/01/2015 Days since previous order = 5


      I would like to do this using L.O.Ds., so that even if we have the order date filter to 07/02/2015 only, the above order 3, will still show 5 days since previous order.


      I imagine I have to do something like


      [order date] minus [previous order date]


      where [previous order date] = maximum order date for that email address, that is less than order date of this order,


      Thank you in advance.