5 Replies Latest reply: Oct 8, 2013 6:59 PM by matthew thompson RSS

    Accumulate a value(s) with a condition

      Hi,

       

      I'm trying to create a field that accumulates a value based on the following conditions. If on any give day, revenue equals 0, that days traffic is passed along to the following day where revenue is greater than 0. The table below illustrates the objectives:

      Screen Shot 2013-10-08 at 5.26.57 PM.png

       

      The Accumlated Traffic field is what I'd like to create. So, on days 2, 3 and 8, there was no Revenue and these days traffic figures were summed and added to the total of the next day with revenue > 0.

       

      I've tried to achieve this using the peek function on import. I can accumulate traffic where revenue equals 0, but cannot find a way to pass the accumlated value to the next day where revenues greater than 0.

       

      Any help is welcome. I've attached a qvw with the above example and what I've scripted so far.

       

      Best,

       

      Matt