Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
aditi_haldule
Contributor III
Contributor III

TOP 10 values in descending order

Hi ,

I want to show a table showing top 10 account names with respect to the revenue generated by them.

so currently I'm showing a few columns in the table as- account name, revenue, region,etc.

I want to show only top 10 rows that generate the max revenue from these that too in the descending order. how do i do that?

2 Replies
PradeepK
Creator II
Creator II

You can create calculated dimension using Aggr() and Rank() functions to get top N revenue generating accounts.

Refer to this code template and disable "Include Null values" option

Aggr(
	if(Rank(Total <Measure>) <= <Top n> , <Filter DIM>
    )
    ,<All DIM List>
)

 

Below are few examples for some real world scenarios

Simple case: 

Aggr(
	if(Rank(Total Sum([Total Sale Amount])) <=10 ,Customer
    )
    ,Customer, Region
)

Rank Simple.PNG

 

Duplicate case:

=
Aggr(
	if(Rank(Total Sum([Total Sale Amount])) <=10 ,Customer
    )
    ,Customer, Region ,SalesRepresentative
)

Rank duplicate.PNG

 

aditi_haldule
Contributor III
Contributor III
Author

Thanks a lot! Will try this