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

largest 5 values in staright table

Hi

i have  a straigt table where i want to display largest 5 values

when i'm making the dimension limits to largest 5 its not working

and the values are showing like this

   

regioncountrytotal
aIND22
bVNM33
cBGD2
cVNM34
dARE2
dBRN12
dCHN8
dIND533
dMYS12
fLKA84
fMYS232
fSGP

2

i want the output as below

   

aIND22
bVNM33
cVNM34
dIND533
fMYS232
1 Solution

Accepted Solutions
beck_bakytbek
Master
Master

Hi John,

try this:

Calculated Dimension: if(aggr(rank(sum(Total)),Country)<=5,Country, Null())

and dont Forget to check: Suppress When Value is Null

i hope that helps

beck

View solution in original post

20 Replies
marcus_sommer

You could try something like this:

if(max(value) = max(total <region> value), max(total <region> value), null())

and suppressing NULL within the tab presentation.

- Marcus

Not applicable
Author

Hi Marcus can you please elobrate where should i use this expression

marcus_sommer

This was meant as a normal expression. If your value isn't direct a value else an aggregation over various values then you will need an additionally aggr-function within the expression like:

if(max(aggr(sum(value), region, country)) = max(total <region> aggr(sum(value), region, country)),

     max(total <region> aggr(sum(value), region, country)), null())

- Marcus

Not applicable
Author

I tried it but no luck Marcus

marcus_sommer

Try it at first only with expression-parts like:

max(total <region> value)

max(aggr(sum(value), region, country))

and play a bit with them - with and without total, aggr and so on to get the right results with which you could further work.

- Marcus

harishkumarg
Creator III
Creator III

Hi,

Dimensions - region,country

expression - aggr(max(total),region)

I tried the above and it worked for me.

Please let me know if you the QVW.

Regards

Harish

Not applicable
Author

Hi Harish

=sum(TOT_)  is the expression i'm using and its a different field

my dimensions are  region,country

i'm getting output as below

i doont want to show the the val;ues marked in red because for a region these are not the max values we have other values which are greater than these

Anil_Babu_Samineni

Is This you are expecting?? Marcus Expression Should work

Capture.PNG

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
harishkumarg
Creator III
Creator III

If TOT_ is your field name then change your expression as aggr(max(TOT_),region)

If it is not working can you share some sample data.

Regards

Harish