Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have applied ranking of sum(sales) by item. There are some products in more than one category (Product F below). The ranking seems to be arbitrarily applied to the product in the category with lower sales and is displaying that product first when I sort by rank ascending and then product sales desc.
If i change the sort to product sales desc and then rank I get the below which then doesn't show the rank where i would like to see it:
Here is what I would like to see:
Note that with my small sample data, I am seeing the expected results.
What could be happening to cause this and how can I fix it?
Many thanks!
If you want the ranking to be calculated over all products and categories, you can use Aggr() with both dimensions:
Aggr(Rank(total ProductSales, 4), Product, Category)
If you want the ranking to be calculated over all products and categories, you can use Aggr() with both dimensions:
Aggr(Rank(total ProductSales, 4), Product, Category)
Thank you @LRuCelver - adding total was the key! without, each product had it's own rank. My understanding is that aggregate is saying to use these dimensions and total says to ignore the dimensions. Can you please break down for me in pseudocode how this is interpreted?