Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Michiel_QV_Fan
Specialist
Specialist

Rangesum or aggr or ??

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!

Labels (1)
2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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 ....


talk is cheap, supply exceeds demand
Michiel_QV_Fan
Specialist
Specialist
Author

Additional info is needed .

The starting value = calculated from the field where statuscode = running.

This results in 1 value because running is only once in the data, at 2012-01-01. Therefore each Starting value is the sum of running at 2012-01-01 + new.

Thanks