Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to use rank, aggr?

Hi,

I'm not sure how to get my chart to show the following

Country      Avr

US           19,33

FR           14


The average value is the average of the top 3 value for each Person

Data:

Country Person Value

Us      A      13

Us      A      12

Us      A      14

Us      A      12

Us      A      15    

Us      b      12

Us      b      11

Us      b      14    

Us      c      12

Us      c      11

FR      c      14    

FR      f      13

FR      f      13

FR      f      13    

FR      a      15

FR      a      15

FR      a      15 

FR     a       12 

1 Solution

Accepted Solutions
ramoncova06
Partner - Specialist III
Partner - Specialist III

it would be easier done at script level by adding a sequence number/

View solution in original post

7 Replies
sunny_talwar

Not sure how you are getting those results?? Would you be able to give a excel document which shows how the average numbers are calculated?

Best,

Sunny

Not applicable
Author

Hi,

First of all thank's for taking the time to help. I do understand why you did not understand the calculation I made a mistake when i did my example.

I have no excel on the computer I' on now but made an example on google sheets. Hope you can read that one

QV-EX - Google Sheets

ramoncova06
Partner - Specialist III
Partner - Specialist III

it would be easier done at script level by adding a sequence number/

Anonymous
Not applicable
Author

I can't see how any calculation of average for US can be over 19 when the max US value for a person is only 15.

Agree with Sunny, the logic of the calculation should be provided...

pratap6699
Creator
Creator

=aggr(if(rank(sum(value)>=3,person),person)

Kushal_Chawda

I think you can do this way

Not applicable
Author

Thank's for all the help solved it in the graph with the suggestion above.