Announcements
cancel
Showing results 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

 region country total a IND 22 b VNM 33 c BGD 2 c VNM 34 d ARE 2 d BRN 12 d CHN 8 d IND 533 d MYS 12 f LKA 84 f MYS 232 f SGP 2

i want the output as below

 a IND 22 b VNM 33 c VNM 34 d IND 533 f MYS 232
1 Solution

Accepted Solutions
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

20 Replies

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

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

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

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

Is This you are expecting?? Marcus Expression Should work

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
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

Community Browser