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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

avg?

Hi i have table like

products,amount

apple,100

banana,200

orange,300

.

.

.

.

.

finapple,100   like this i have 100 rows of data

i want top 5 and top 10 avg sales

give me expr?

1 Solution

Accepted Solutions
Not applicable
Author

=avg({<products={"=rank(avg(amount))<=5'}>}amount)

View solution in original post

8 Replies
giakoum
Partner - Master II
Partner - Master II

in a chart?

use avg(amount) as expression

products as dimension

and use the dimension limit tab to limit it to the first 5 or 10

Not applicable
Author

thats ok fine instead of using dimension limit i want write a expression

mdmukramali
Specialist III
Specialist III

Dear,

Use can use

=Sum({<Products = {"=Rank(Sum(amount)/ Sum(TOTAL amount))<=5"}>} amount) / Sum(TOTAL amount)

giakoum
Partner - Master II
Partner - Master II

An expression in a text object for example, will return a single number. What is it exactly that you want to do?

Not applicable
Author

try this,

=if(rank(avg(sales))<=5,avg(sales))

Anonymous
Not applicable
Author

here i am getting other record names also including top5

for top5 i can see bars

but for rest of the things i am getting products name , i want remove all things i want see only top 5 in the chart

giakoum
Partner - Master II
Partner - Master II

=if(rank(avg(sales))<=5,avg(sales),null())

and use suppress missing

Not applicable
Author

=avg({<products={"=rank(avg(amount))<=5'}>}amount)