2 Replies Latest reply: Oct 18, 2011 2:15 AM by Peggy Boltz RSS

    How to sum the ordervalue of the last 3 orders?

    Peggy Boltz

      Hi,

       

      how can I sum up the last 3 Orders of a customer?

       

      I tried it with rank-function, but a sum() on rank() doesn't work.

       

      sum(if(rank(Orderdate)<=3,sum(Ordervalue),0)) 
      

      Please see my application in attachment.

       

      Do you have a solution?

       

      best regards

      Peggy