Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Read about the latest Qlik Community enhancements on the Community News blog!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Getting Top 4 Sum instead of Top 5 Sum ...?

Hi Frnz,

I want Top 5 Sum fot AMID and AMID_ID. I am getting for AMID_ID but not for AMID.

Something wrong, Please help me to find solution.

Please find the attached QVW.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

That's because your advanced aggregation is not aware of your AMID filtering in the chart dimension, thus considering 'TTTT' when ranking, but filtering it when matching advanced aggregation dimensions with outer chart dimensions.

You would need the dimension filter also in the inner aggregation (since aggr() function does not allow a calculated dimension):

=sum(aggr(if(rank(sum( {<AMID -= {"TTT*"}>} Sale))<=5,sum(Sale)),YEAR,AMID))

View solution in original post

2 Replies
swuehl
MVP
MVP

That's because your advanced aggregation is not aware of your AMID filtering in the chart dimension, thus considering 'TTTT' when ranking, but filtering it when matching advanced aggregation dimensions with outer chart dimensions.

You would need the dimension filter also in the inner aggregation (since aggr() function does not allow a calculated dimension):

=sum(aggr(if(rank(sum( {<AMID -= {"TTT*"}>} Sale))<=5,sum(Sale)),YEAR,AMID))

View solution in original post

qlikviewwizard
Master II
Master II

Nice one.