Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rank Within a Dimension

I created buckets to get the sales of the top X number of clients in a chart using the following expression.

if (BuckettA = 'Top10', sum({$<Year={2009},Customer = {"=rank(sum({$<Year={2009}>}Sales)) <= 10"}>} Sales)/sum({<Year={2009}>}Sales),

if(BucketB = 'Top20', sum({$<Year={2009},Customer = {"=rank(sum({$<Year={2009}>} Sales)) <= 20"}>} Sales)/sum({<Year={2009}>}Sales),

if(BucketC = 'Top30', sum({$<Year={2009},Customer = {"=rank(sum({$<Year={2009}>} Sales)) <= 30"}>} Sales)/sum({<Year={2009}>}Sales),

null())))

I layered a dimension of Salesgroups onto the expression above.

The result I'm getting is that all the SalesGroups are pulling the TOP 10/20/30 RANK FOR ALL OF 2009 across ALL SALESGROUPS instead
of the top 10/20/30 RANK WITHIN THE SALESGROUP.

Can someone point out to me how I can adjust/change my expression above to make the ranks within each bucket apply WITHIN THE DIMENSION SalesGroup?

Thank you in advance...
2 Replies
fernandotoledo
Partner - Specialist
Partner - Specialist

I didn't exactly what you are trying to do. What type of chart are you creating? Is the Customer a visible dimension in the chart? The expression seems ok, but too complex! Try using this sequence SUM( {$...} IF( Bucket..., Sales))

fernandotoledo
Partner - Specialist
Partner - Specialist

I didn't get exactly what you are trying to do. What type of chart are you creating? Is the Customer a visible dimension in the chart? The expression seems ok, but too complex! Try using this sequence SUM( {$...} IF( Bucket..., Sales))