6 Replies Latest reply: Dec 5, 2016 9:32 AM by Chris Waterworth RSS

    Reference a previous row in table.

    Chris Waterworth

      Hi Qlik

       

      I am looking at a problem where I have a site that produces 10 units a day and has capacity of 50units. I want to put together a delivery schedule where I'm cumulating the number of units on site that resets once the site reaches 50 eg see table below:

       

       

      DayQuantity
      Monday10
      Tuesday20
      Wednesday30
      Thursday40
      Friday50
      Saturday10
      Sunday20

       

       

       

       

       

       

      The formula needs to be something along the line of

      IF( Previous days quantity (Q-1) + Increase (P) > Capacity (C),

       

       

      Q-1 + P -C,

      Q-1 +P)

       

       

      However I don't know how to reference the previous quantity. When culminating values before I have used rangesum(above( but to be entirely honest don't full understand the function.

       


      Any help would be much appreciated.

       

      Kind regards