Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
clarenceclay
Contributor II
Contributor II

Range sum with above function

bar.jpg

Hi folks,

Refer above line chart. Im using range sum with above function. How can we use range sum with above function but limit the years to show only top 5 years say from 2012 to 2017. 2012 sum would be the total from the start year up to 2012.

1 Solution

Accepted Solutions
sunny_talwar

May be multiply you expression with this

Avg({<Year = {"$(='>=' & (Max(Year) - 5) & '<=' & Max(Year))"}>} 1)

View solution in original post

7 Replies
sunny_talwar

May be multiply you expression with this

Avg({<Year = {"$(='>=' & (Max(Year) - 5) & '<=' & Max(Year))"}>} 1)

clarenceclay
Contributor II
Contributor II
Author

Hi Sunny,

Really appreciate your answer but I am not so sure how am i going to incorporate your solution into my current expression below

Expression

Rangesum(above(count(Company_no),0,RowNo()))

Thank you in advance

sunny_talwar

Just this

RangeSum(Above(Count({<Year>}Company_no),0,RowNo())) * Avg({<Year = {"$(='>=' & (Max(Year) - 5) & '<=' & Max(Year))"}>} 1)

clarenceclay
Contributor II
Contributor II
Author

Hi Sunny.

Your solution works great. Love it. One last question, how can we get the chart to only display those 2012 and above data? get rid of those empty year values.

bar1.JPG

Again, thank you very much for your professional help.

clarenceclay
Contributor II
Contributor II
Author

Hi Sunny, I figured it out. Just unchecked the include zero values. Thanks again for your lovely solution.

sunny_talwar

Superb

sunny_talwar

Please close the thread by marking the correct response.

Best,

Sunny