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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Cumulative totals

Hi,

I have a year field which contains 100years(1915 to 2015) of data. if I select one year like 2013 it has to show the count(Contracts) for 2013,2012,2011,2010(ie last 4years of selected year) in line chart with cumulative totals.(ie 2013 shows sum(contracts ) from 1915 to 2013 and 2012 shows sum(contracts) from 1915 to 2012,...).

Thanks in advance

Best Regards

Anusha K

Labels (1)
16 Replies
maxgro
MVP
MVP

Anonymous
Not applicable
Author

How to display selected year and last 3 years of selected year data in line chart

Anonymous
Not applicable
Author

Here year is a dimension for line chart and count(contracts) is expression

Anonymous
Not applicable
Author

Anusha,

Can you attach a sample application after reducing the data.

Thanks

BKC

sunny_talwar

I was gonna ask the same thing

Anonymous
Not applicable
Author

Hi,

You can try this expression

Count({<Year={'>$(=max(Year)-3)<=$(=max(Year))'}>}Contracts)

Regards,

Greeshma

john_s_w_wood
Creator
Creator

If the accumulate function on the expression tab doesnt work for you you may nee to use the rangesum,above and rowno functions thus

rangesum(above(count(contracts),0,rowno()))

this should accumulate for you. Ill send an example shortly

john_s_w_wood
Creator
Creator

In the example attached, above is used to look at previous records. the format for the whole statement is

rangesum(above(aggregate(data), to how many rows above 0 = current row, how many rows back to start from which is given by rowno() which takes the accumulation back to the first row))

Anonymous
Not applicable
Author

@ !Hi Team,

Sorry for my late response.

Please check the below file.In this The expression shows all the years cumulative totals .when i select on year filter it has to show last 3 years cumulative totals data like if i select 2014 it has to show 2014, 2013,2012 with cumulative totals.In line chart like 2014-500,2013-350,2012-220

Please help me to fild solution for this it is an urgent requirement in my project.

Thanks in advance

Best Regards

Anusha k