2 Replies Latest reply: Dec 24, 2012 8:29 AM by Michiel van de Goor RSS

    Rangesum or aggr or ??

    Michiel van de Goor

      Hi,

      I have the following challenge:

      I need to have a table where

      dimension = first day of the month

      expression = count of files

       

      We have a starting value at the beginning of the year and we need to calculate like this:

      The first value = 100 and has been identified bij status code: 'running'. The new values are identified by status code: 'new'.

       

      DateStarting
      new
      Ending
      2012-01-0110010110
      2012-02-01110-5105
      2012-03-0110560165
      2012-04-01165-20145
      2012-05-011451146
      etc.


       

      We also need to have the Starting value calculated correctly when for instance 2012-03-01 is selected:

       

      DateStarting
      NewEnding
      2012-03-0110560165
      2012-04-01165-20145
      etc.


       

      What function do I need to achieve this?

       

      Thanks and happy holidays!

        • Re: Rangesum or aggr or ??
          Gysbert Wassenaar

          Calculate the values in the script using the peek function:

           

          load

                Date,

               if([status code]='running', count_of_files, peek('Starting' + peek('count_of_files') as Starting,

               if([status code]='new', count_of_files, 0) as new,

               if([status code]='running', count_of_files, Starting + count_of_files as Ending

          from ....