Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I would like to display a rank for a selected product. What I have now is a table with the Dimension 'productname' and a measure like that: 'rank(sum(SALES))' . What that does without filtering is to show me the ranks for each product nicely in a table. But as soon as I filter on a productname I always get Rank 1 for that product. Which makes sense of course, but what I need is that the measure shows me the actual rank for the product. Can someone help me on that?
Best regards
Try this:
Rank(Sum({1} SALES)) * Avg(1)
UPDATE: Fixed the expression to add the missing parenthesis after the OP pointed out.
Try this:
Rank(Sum({1} SALES)) * Avg(1)
UPDATE: Fixed the expression to add the missing parenthesis after the OP pointed out.
hey, thanks for the quick reply,
unfortunately this still shows me rank 1 for every selected product 😕
Are you sure you added {1} to the sum(sales) expression?
yeah Im sure, I just copy pasted what you posted and added a bracket, which seems to miss?
So: Rank(Sum({1} SALES) * Avg(1)) is what i used.
This is what I get with your suggestion:
Sense still seems to make a new ranking based on what I filter on 😕
EDIT: Ok I see... I put the bracket at the wrong position. My bad and thank you!
One more question:
Is it possible to display this rank as a KPI ? Whats the syntax for that? It doesnt seem to work for the same syntax
Again, thank you very much
Hi sunny,
This expression is working fine.
Can you please explain how avg(1) is working.
So you can try this, but this will display a comma separated list of all ranks when you haven't selected a single productname.
Concat(Aggr(Rank(Sum({1} SALES)) * Avg(1), ProductName), Chr(10))
If you only ever want to see this when you have only one selected, then may be this:
Only(Aggr(Rank(Sum({1} SALES)) * Avg(1), ProductName))