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: 
Anonymous
Not applicable

Running sum of only Previous and Current Month

Hi,

Following Data set :

  

Dimension Month Amount
B1Jun5
July6
August15
September12
October18
November2
December6
B2Jun24
July0
August21
September9
October56
November41
December

20

what i want is to add previous Amount values in the current month and show zero values in the previous month.

Like for Example For Dimension B1 :

Current Month August 

it should show 15+6+5 = 26 instead of 15 , and show zero values in Jun and July.


What i was doing in the script


IF(Month(Date#(Month_field,'YYYYMMDD'))=Month(Today()),Previous(Rangesum((Amount))),Amount) AS Amount,


the issue is, its range sum the very previous record in the field but not all the values.

like for B1 Dimension for August i got the value 21 instead of 26

and in B2  Dimension for August i got the value 21 as the very previous record is 0.

is there any way we can add the all the previous amount values into one.


Thanks


10 Replies
sunny_talwar

Difficult to say what might be the issue. Would you be able to share a sample where you see the issue?