Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to do cumulative sum in qlikview

Hi Team,

Please help me in doing the Cumulative sum.I have 5 years of data in the input file but my report has to show last 2 years data.

For each month I want the sum from beginning to current month .For your reference attaching the sample data .

Input file

===========

yearmonthValue
2014 Nov5
2014Dec10
2015Jan15
2015Feb20
2015Mar25

Output

==============

4 Replies
Not applicable
Author

Sorry output i want in this manner

Thanks in Advance

avinashelite

check this example app

MK_QSL
MVP
MVP

use below script

Test:

Load

  year,

  Date#(month,'MMM') as month,

  Value

Inline

[

  year, month, Value

  2014, Nov, 5

  2014, Dec, 10

  2015, Jan, 15

  2015, Feb, 20

  2015, Mar, 25

];

Final:

Load

  *,

  RangeSum(Peek('TotalValue'),Value) as TotalValue

Resident Test

Order by year, month;

Drop Table Test;

now create a Pivot Chart

Dimension (Both Calculated Dimensions)

1)

=ValueList('Cumulative','Value')

2)

=IF(year = 2015, month)

Expression

IF(ValueList('Cumulative','Value') = 'Cumulative', SUM(TotalValue),SUM(Value))

MK_QSL
MVP
MVP

If you have got your answer, kindly close the thread by selecting appropriate answer so that others can also use it..