2 Replies Latest reply: Aug 1, 2012 6:30 AM by ajones13 RSS

    Accumulate Field Until the sum of Another field reaches predefined limit

      I have a situation in Qlikview that I would like to ask your advice on. We are currently running a number of promotions which we are reporting in Qlikview. For each stock item on promotion there is a threshold value (i.e. the amount available for sale at promotion price).

       

      To add a bit of difficulty the product isn’t always sold at the same price during a promotion. What I need to show is the sum of the sales value for all sales before the promotion threshold was passed e.g:

       

      Stock ID                Qty         Price

      1                              1              2.10

      1                              1              2.10

      1                              2              2.00                       

      1                              1              2.10

      1                              1              2.10

       

      In the above example the promotion threshold will be 5 (i.e. once 5 are sold I no longer want to include the product in my sum)

       

      Therefore the total revenue for Stock ID 1 will be 10.30. The last sale should not be included as it happened after the threshold was met.

       

      My question is what is the best way to complete this in Qlikview?

       

      Thanks

       

      Andrew