Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
JackRen3
Contributor II
Contributor II

Selection of top N brands given a measure computed through an expression

Hello I would like in my report to limi the number of brands represented (at the moment they are more than 100). I would like to select the top 5 brands given this measurement:

(sum({$<year={$(=GetFieldSelections(year))}>} sales_units) / sum({$<year={$(=GetFieldSelections(year))}>} total <month> sales_units))

The expression above computes the market share for a given year (the one selected with the filter). 

I would like to find the top 5 brands that have the highest value for that measurement and so to filter all across my dashboard and visualize data only for those brands.

Over time the brands could change, so I need a dynamic solution. Does any of u guys know how to do this?

1 Reply
MatheusC
Specialist
Specialist

Hello,

you could try something like

 

if(

Rank(

(sum({$<year={$(=GetFieldSelections(year))}>} sales_units) / sum({$<year={$(=GetFieldSelections(year))}>} total <month> sales_units))<=5,

(sum({$<year={$(=GetFieldSelections(year))}>} sales_units) / sum({$<year={$(=GetFieldSelections(year))}>} total <month> sales_units))

)

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!