Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to calculate a cumulative column

Hello,

Just started to work with V9 SR4 licence

Based on below data set , would like to know how to calculate M² Cumul , with same result as the last column calculated via export to excel !

PHASEWO #WorkshopM² cumul
TotalTotalTotalTotal35 177,39
10.Photo interne51853En Attente0,240,240,24
10.Photo interne53619En Attente0,240,240,48
10.Photo interne53633En Attente0,240,240,72
10.Photo interne52919En Attente0,480,481,20
10.Photo interne53054En Attente0,480,481,68
10.Photo interne52659En Attente0,541,082,76
10.Photo interne52663En Attente0,541,083,84
1 Solution

Accepted Solutions
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

If you need to calculate it in the Chart (like a Straight Table), you can either mark the Expression with "Full Accumulation" (on the "Expressions" Tab), or use function above(column(N)) to add the value from the previous line - just be careful with the first line, because in the first line function above() returns a null(). The following should work:

RANGESUM( ABOVE( Column(3), Column(2))

Function RANGESUM will add the two values together, while replacing nulls with zeros. Column(3) is the accumulated column, so you use the value from the line above and adding to it the current value of the Column(2).

View solution in original post

5 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

If you need to calculate it in the Chart (like a Straight Table), you can either mark the Expression with "Full Accumulation" (on the "Expressions" Tab), or use function above(column(N)) to add the value from the previous line - just be careful with the first line, because in the first line function above() returns a null(). The following should work:

RANGESUM( ABOVE( Column(3), Column(2))

Function RANGESUM will add the two values together, while replacing nulls with zeros. Column(3) is the accumulated column, so you use the value from the line above and adding to it the current value of the Column(2).

Not applicable
Author

Many thanks for your immediate answer. I have tried a lot of things based on your advice but without success

I have attached a cumul.qvw file to help in the resolution

could you have a look at it to identify the right setup

thanks in advance

Not applicable
Author

Hi

Part of your problem there was that you had included M2 as a dimension, which has an impact on the RangeSum and full accumulation aspects, so the example I have attached moves M2 into the expressions list.

I included two expressions using RangeSum as per Oleg's suggestion, both of which are working fine.

Also..... in your load script there is no closing ]; at the end of your LOAD INLINE statement, I'm not sure of the impact of this but it might be unpredictable so I added that in.

Regards,

Not applicable
Author

Hello ,

thanks for your reply

Again , I have not been able to reproduce just because when adding a new dimension, it is no more working.

In fact i am just not understanding the syntax of this expression.

My need is to do a list of record with a CPT as a unique key but not being the first one for a sort of data and with a lot of dimensions and with a cumul of a numeric field : list of work orders sorted by priority id, date of expedition , ... and with a cumul at line level of M²

martino
Partner - Contributor III
Partner - Contributor III

Hi NigelWest,

Do you by that mean that it is not possible to make an Accumulated Column if there are more than one Dimension in the table?

Best regards

Martin