Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
PaulaRibeiro
Partner - Contributor II
Partner - Contributor II

Accumulated chart

Hi,

I have some difficulties for calculating the accumulated sum.  I have a line chart where I calculates the sum of the values since the beginning of the year.

I use the function RangeSum() and Above() and the line of values when I don't have any year selected is correct.

My issue is when I select one year, the values doesn't accumulate.

Any ideia to resolve that?

Best Regards


1 Solution

Accepted Solutions
sunny_talwar

Can you make sure that you have checked 'Suppress Zero Values' on the presentation tab of the chart properties?

View solution in original post

15 Replies
sunny_talwar

Assuming this is your expression

RangeSum(Above(Sum(Measure), 0, RowNo()))

try to change it to this

RangeSum(Above(Sum({<Year>}Measure), 0, RowNo())) * Avg(1)

sergio0592
Specialist III
Specialist III

Sunny can you explain why you use * Avg(1)?


Thanks

sunny_talwar

Year in the main expression will ignore selection in Year field... which would means that if the user selected 2014, they will continue to see all the years. In order to see the accumulated value only for 2014, Avg(1) is used. Avg(1) will equal 1 for selected year and 0 otherwise

sergio0592
Specialist III
Specialist III

Ok, i understand. Foxy trick! Thanks.

PaulaRibeiro
Partner - Contributor II
Partner - Contributor II
Author

It worked for the values, but when I select the year, the x-axis dimension year does not fit, show me every year. As for the row, the selected year appears and the remaining area is empty for the other years.

sunny_talwar

Would you be able to share an image of what you are seeing?

PaulaRibeiro
Partner - Contributor II
Partner - Contributor II
Author

I have the expression

RangeSum(Above(Sum({<YearMonth} Measure1),0,RowNo()))

/ RangeSum(Above(Sum({<YearMonth} Measure2),0,RowNo()))*avg(1) and values doesn't acummulated.

If i have

RangeSum(Above(Sum({1<YearMonth} Measure),0,RowNo()))

/RangeSum(Above(Sum({1<YearMonth} Measure),0,RowNo()))*avg(1) the values are correct and the line too, for the year selected, but the graph show me every years.

sunny_talwar

Sample or an image?

PaulaRibeiro
Partner - Contributor II
Partner - Contributor II
Author

Image. Basically, i select Year 2018 and the dimension Year of the graph show me every years, but in the graph where i have year 2017 i don't have line