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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Accumulating values on each time range

Hello!

Well i think this should be easy but the worse thing is that i can not solve it yet.

I have a table containing an order list and time span. I am having a chart viewing the value for each month which is working fine. Now i want to create a chart to list the accumulated value from the previous month/months on each month. That is to say jan will show only jan values but feb with show the sum of values from jan and feb, and so on at last dec will show the sum of the values from jan to dec.

How can i achieve this in the easiest way ?

11 Replies
Not applicable
Author

Hi, I have the same problem

I have an expression as follows: its name is "CASH FLOW"

sum ( {<class = {a}>} [Balance] / sum ( {<{class = {b}>} [Balance])

when I accumulate = it accumulates the ratios - which is not what I want

I want - "cumulative" sum ( {<class = {a}>} [Balance] / "cumulative" sum ( {<{class = {b}>} [Balance])

The dimension is period i.e. Year 1, 2, 3 etc

johnw
Champion III
Champion III

Rangesum(above()) should still work. Create separate hidden expressions for the class a and class b balances, then rangesum each over the current row and all above rows. Probably something like this:

Class A Balance = sum({<class={'a'}>} Balance) // hidden expression
Class B Balance = sum({<class={'b'}>} Balance) // hidden expression
Cash Flow = rangesum(above("Class A Balance"),0,rowno())
/rangesum(above("Class B Balance"),0,rowno())

A better approach might be to handle it with data, though. Let's say your first year was 2001:

AsOfYear, Year
2001, 2001
2002, 2001
2002, 2002
2003, 2001
2003, 2002
2003, 2003
etc.

Use AsOfYear in the chart, and the sums will be a full accumulation (don't set the full accumulation option), and will work when dividing the sums.