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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

help needed in different cumulation

Hi all

consider the following scenario,

input table..... output table...........

Year Value Year value output

2007 10 2007 10 (10+20+15+40)=85

2008 20 2008 20 (10+20+15)=45

2009 15 2009 15 (10+20)=30

2010 40 2010 40 10

I would like to show the chart like output table as shown above.....

could anyone help me to solve this problem............

thanks in advance.......

3 Replies
tanelry
Partner - Creator II
Partner - Creator II

You can make a pivot table and use before() or above() depending on layout.

For example output expression:

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

returns row accumulation from top to bottom.

Not applicable
Author

Hi

Its not cumulation...

could anyone help me to solve this problem.....

spsrk_84
Creator III
Creator III

Hi,

we tried to achieve the required output in script level and i think we achieved it...

See the script below and confirm

nv:
load * inline [
Yearss,vals
2007,10
2008,20
2009,30
2010,40 ]
;

nv1:
LOAD MAX(Yearss) as MaxVal,
MIn(Yearss) as MinVal RESIDENT nv;


LET a=PEEK('MinVal',0,'nv1');
LET b=PEEK('MaxVal',0,'nv1');

let x = 0 ;

for i = $(a) to $(b)

load

$(i) as yrr,
sum(vals) as op

resident nv
where Yearss <=('$(b)')-('$(x)') ;

let x = x+1 ;

next



Regards,

Ajay