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: 
Anonymous
Not applicable

Aggr rangesum performance tuning.

Hi All,

I have a situation where there is a date slider  (rolling 13 months) and stacked bar charts on dashboard. All these stacked bar charts are using expressions

aggr(rangesum(above(sum({<some filters>}Count_1)),0,rowno()), date_range,category)

/

aggr(rangesum(above(sum(TOTAL{<some filters>}Count_1)),0,rowno()), date_range,category)

filters are on date_range, flags etc.

This expression is causing my application to hang and on server it takes 7-10 minutes to respond to any change in date slider.

I did this to show cumulative sum view on charts.

My data look like :

MonthCategory 1Category 2Cumulative Sum Category 1Cumulative Sum Category 2
Jan 201620702070
Feb 20163012050190
Mar 2016151865208
Apr 2016172382231
May 20162882110313
Jun 20164447154360

Cumulative sum is not present in my data base, also since i am using slider so i can't pre-calculate it in script and then use on Dashboard.

I know that the only way to handle this is perform these calculation at script level and i tried but messed things. Can anyone share a qvw showing how to carry this in script.

Thanks,

Stabdha

4 Replies
Frank_Hartmann
Master II
Master II

hi,

try in script as following:

LOAD

    Month,

    [Category 1],

    [Category 2],

    RangeSum(Peek(newCat1), [Category 1])  as newCat1,

    RangeSum(Peek(newCat2), [Category 2])  as newCat2

FROM

hope this helps

Anonymous
Not applicable
Author

Hi Frank,

Thanks for the solution but my time period is not constant, i have a slider and data should keep changing according to the slider. e.g.

Check for Mar2016 data, cumulative is now depending on the selected time period (Feb 2016 to mar 2016 and not Jan-Mar 2016).

Thanks,

Stabdha

Frank_Hartmann
Master II
Master II

see attached qvw

hope this helps

Anonymous
Not applicable
Author

Thanks for the solution Frank. I too used similar expression but the issue i mainly faced is of performance. When i change the date range through slider the charts take forever to load. That's why i wanted to somehow calculate the same on script and use it on UI for better performance.