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: 
n1ef5ng1
Creator
Creator

Accumulative

Hi Guys,

Is there any way I can create such a accumulation on my expression?

Desire output

DateValueAccumulative Value
Jan 201111
Feb 201123
Mar 2011710
Apr 2011414
May 2011519
June 2011827
July 20111037
Aug 211239
Sep 2011746
Oct 2011248
Nov 2011149
Dec 2011857
Jan 2012`99
Feb 2012110
March 2012919

The accumulative value will reset once it reach end of Dec. Is there any way I am able to do that?

I am using this code at the moment rangesum(above(sum(TEU),0,mod(month(Year),12)+1)), and it is not working. thanks

16 Replies
kumarnatarajan
Partner - Specialist
Partner - Specialist

Hi,

Try this one.

RangeSum

(Above(Sum(Value),0,RowNo()))

see the attached file

kumarnatarajan
Partner - Specialist
Partner - Specialist

Hi,

Else one another way for Accumulative. see below screen short

Accumulation.jpg

n1ef5ng1
Creator
Creator
Author

I am using personal edition, could not open your qvw file.

regarding your code, I am unable to get the desired value.

n1ef5ng1
Creator
Creator
Author

Full accumulation will continue to accumulate even if it move to next year. I want it to reset back to 0 when is a new year.

n1ef5ng1
Creator
Creator
Author

hello any help~~ kinda urgent

Sokkorn
Master
Master

Hi,

You can try this load script

[Data]:

LOAD * Inline [

Period    ,    Value

Jan 2011    ,    1

Feb 2011    ,    2

Mar 2011    ,    7

Apr 2011    ,    4

May 2011    ,    5

Jun 2011    ,    8

Jul 2011    ,    10

Aug 2011    ,    2

Sep 2011    ,    7

Oct 2011    ,    2

Nov 2011    ,    1

Dec 2011    ,    8

Jan 2012    ,    9

Feb 2012    ,    1

Mar 2012    ,    9];

[Acc]:

LOAD

    Period,

    Value,

    RangeSum([Value], Peek('AccVal1'))    AS [AccVal1],

    IF(Right([Period],4) = Previous(Right([Period],4)), RangeSum([Value], Peek('AccVal2')),[Value]) AS [AccVal2]

Resident [Data];

DROP table [Data];

Regards,

Sokkorn

er_mohit
Master II
Master II

try this

rangesum(above(sum(Value),0,RowNo()))

see the attached file it works for me

n1ef5ng1
Creator
Creator
Author

I tried your formula.

My data range from Jan 2011 - Apr 2013

Jan to Dec 2011 the value is 20000000

Jan 2012 it still accumulate from 20000000 to 23300000

However my desire output is Jan 2012 to reset back to 0 and accumulate from there

er_mohit
Master II
Master II

yeah same in above attached application and see the expression acc

it accumulate like what you want