Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

aggr function - Taking more time

Hi All,

I am using below code in my combo chart to calculate YTD Average.

Dimensions: DEPT,PRODUCTTYPE

Selection: MONTH,YEAR

aggr(RangeAvg(Above( sum({<Year={$(=Max(Year))}, MONTH>}SALES),0,RowNo())),DEPT,PRODUCTTYPE,MONTH)

/

aggr(RangeAvg(Above( sum({<Year={$(=Max(Year))}, MONTH>}VOLUME),0,RowNo())),DEPT,PRODUCTTYPE,MONTH)

Issue: Application is hanging showing green color loading button when I select MONTH.

Please help me in fine tune the expression.

Thanks in advance.

12 Replies
vinieme12
Champion III
Champion III

do you really need aggr ?? you already have those dimensions in the chart?

Have you tried without aggr()?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

or try below

aggr(

RangeAvg(Above( sum({<Year={$(=Max(Year))}, MONTH>}SALES),0,RowNo()))

/

RangeAvg(Above( sum({<Year={$(=Max(Year))}, MONTH>}VOLUME),0,RowNo())),DEPT,PRODUCTTYPE,MONTH)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

Hi vinieme12

Those two DIMENSIONS DEPT,PRODUCTTYPE are in chart. MONTH is the selection.

Shall I remove aggregate function?

Could you give updated expression?

vinieme12
Champion III
Champion III

also i think you are averaging the average here? is that exactly what you need?

Normally


RangeSum(Above( sum({<Year={$(=Max(Year))}, MONTH>}SALES),0,RowNo()))

/

RangeSum(Above( sum({<Year={$(=Max(Year))}, MONTH>}VOLUME),0,RowNo()))

Average – Which average?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

have you tried after removing Aggr() ?? also are you sure you are doing the correct average? check my replies below

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

I want YTD average of SALES/VOLUME.

vinieme12
Champion III
Champion III

Buddy can't help you much with that , you should know what results you want.

I can only help you if the results are not as expected.

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

I will try and let you know.

Not applicable
Author

Please find the sample data.