Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
peerae92
Contributor
Contributor

Aggregated metric by ranked dimension

Hi Guys 

I am looking to aggregate a metric by a ranked dimension by i'm getting some errors:

MakeModelPrice
FordFocus$5,000
FordMondeo$8,000
Peugeot206$2,000
Peugeot106$5,000
ToyotaYaris$4,000
ToyotaCamry$12,000
ToyotaPremio$8,000
HondaCivic$2,500
Hondahr-v$4,000

 

Above is a test example. I want to find the top 2 'Make' based on the highest price (in this case Ford = $13,000 and Toyota = $24,000). Then based on them, I want to count how many models there are (in this case Ford = 2 and Toyota = 3). 

The final output I want is just the metric 5 (2+3). I have used lots of different combinations of aggr, rank, variables etc but cannot get it to work without pulling in the 'model' dimension as a table. 

Any help of how to do this so that I can just display as a metric would be much appreciated. 

Thanks

Labels (1)
1 Reply
tresesco
MVP
MVP

=Count(  Aggr( NODISTINCT if(rank(Sum(Price))<3, Make), Make) )