Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Cumulated measure

Hi guys,

I've a necessity to build a chart with an cumulative calculation.

Dimensions: Container id, Date

Measures: PRI = if day(Date) = 1 then 1 else TWRR * previous(PRI) end

TWRR is another calculation and can be disregarded.

How to implement this calculation?

Thanks.

1 Solution

Accepted Solutions
PrashantSangle

Hi,

use above or below as per requirement

try like

expression,

if(day(Date)=1,1,TWRR*above(PRI))

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

24 Replies
PrashantSangle

Hi,

use above or below as per requirement

try like

expression,

if(day(Date)=1,1,TWRR*above(PRI))

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anonymous
Not applicable
Author

PRI = above(PRI) renders null. I can't reference myself (chart column) in the Above function. I can only reference some other field, right?

PrashantSangle

Hi,

PRI is column Name or expression???

Syntax :

Above(expr)

qlik below url for detail understanding of above()

Above ‒ QlikView

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anonymous
Not applicable
Author

As per the definition, PRI is the name of the calculation. Which is defined in this way:

PRI = if (day(Date) = 1, 1, CONST * prev(PRI))

So, PRI is eventually a chart column which is designed as a static type of a counter which does not depend on any other field in the data model.

Therefore, PRI = above(PRI) seems impossible for me. And I don't see any other way of implementing this formula in Qlikview except for moving it in the script.

Or am I wrong?

PrashantSangle

Hi,

I am not getting you..

can you provide sample data with required output???

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anonymous
Not applicable
Author

Let's start with this one:

for each date I need to make this calculation.

PRI.png

sunny_talwar

Is it possible to provide the raw data for this in a Excel file to test it out?

Anonymous
Not applicable
Author

Sure.

Find below:

  

DatePRI
01/01/201615
02/01/201622.5
03/01/201633.75
04/01/201650.625
05/01/201675.9375
06/01/2016113.90625
07/01/2016170.859375
08/01/2016256.289063
09/01/2016384.433594
10/01/2016576.650391
11/01/2016864.975586
12/01/20161297.46338
13/01/20161946.19507
14/01/20162919.2926
15/01/20164378.9389
16/01/20166568.40836
17/01/20169852.61253
18/01/201614778.9188
19/01/201622168.3782
20/01/201633252.5673
21/01/201649878.851
22/01/201674818.2764
23/01/2016112227.415
24/01/2016168341.122
25/01/2016252511.683
26/01/2016378767.524
27/01/2016568151.287
28/01/2016852226.93
29/01/20161278340.39
30/01/20161917510.59
31/01/20162876265.89
01/02/201615
02/02/201622.5
03/02/201633.75
04/02/201650.625
05/02/201675.9375
06/02/2016113.90625
07/02/2016170.859375
08/02/2016256.289063
09/02/2016384.433594
10/02/2016576.650391
11/02/2016864.975586
12/02/20161297.46338
13/02/20161946.19507
14/02/20162919.2926
15/02/20164378.9389
16/02/20166568.40836
17/02/20169852.61253
18/02/201614778.9188
19/02/201622168.3782
20/02/201633252.5673
21/02/201649878.851
22/02/201674818.2764
23/02/2016112227.415
24/02/2016168341.122
25/02/2016252511.683
26/02/2016378767.524
27/02/2016568151.287
28/02/2016852226.93
29/02/20161278340.39
sunny_talwar

Isn't this the output you are looking to get? What is CONST here?