2 Replies Latest reply: May 11, 2018 6:27 AM by Hung dep RSS

    How to calculate Sales of previous weeks

    Hung dep

      Hi everyone,

      I got data like this:

        

      DateProductSales
      4/28/2018A1
      4/29/2018A2
      4/30/2018A3
      5/1/2018A4
      5/2/2018A5
      5/3/2018A6
      5/4/2018A7
      5/5/2018A8
      5/6/2018A9
      5/7/2018A10
      5/8/2018A11
      5/9/2018A12
      5/10/2018A13
      5/11/2018A14
      5/12/2018A15
      5/13/2018A16
      5/14/2018A17
      5/15/2018A18
      5/16/2018A19
      5/17/2018A20
      5/18/2018A21

       

      Date will be loaded with AutoCalendar function in Qlik Sense and bear Date.autoCalendar.Week.

       

      Now what i want is a table of calulation like this:

             

         

      WeekSales (expression -> result)Previous-Week-Sales
      W17=Sum(Sales) -> 1??? ->  -
      W18=Sum(Sales) -> 35??? -> 1
      W19=Sum(Sales) -> 84??? -> 35
      W20=Sum(Sales) -> 111??? -> 84

       

       

      Can anyone help me the expression to calculate the previous-week-sales for each week like this? Thank you all of you.