Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jolivares
Specialist
Specialist

Ranking over a dimension

Hi community... I have a question.  I need to rank sales over a dimension, but I forgot something.  Check this out.

The first picture is the sales for Mar/2016 and a Producto Ranking.  The second one shows the same but over three month, having the criteria of ranking of sales of march. Until here, everything is good.

Capture.PNG

Now, if I add a ProdType dimension, the result is unexpected. Look...

Capture.PNG

The result must be: the top 5 product by ProdType, having march as the month for the ranking

I attached a QVW with sample data, in order you can see the problem.  Something is missing, because if I choose one ProdType a get the desire result.

Thanks in advance for your help.

1 Solution

Accepted Solutions
jolivares
Specialist
Specialist
Author

Ok... I got it

Sum({<MonYear, Prod={"=Aggr(Rank(Sum({<MonYear={'$(=MaxString(MonYear))'}>} Sales)),ProdType,Prod)<=5"}>} Sales)

This expresion make the problem solve.

View solution in original post

3 Replies
ecolomer
Master II
Master II

See this example:

jolivares
Specialist
Specialist
Author

Thanks Enrique, I already try this kind of solution including make a straight table but I need that just the Prod in the ranking appear.

Thanks again.

jolivares
Specialist
Specialist
Author

Ok... I got it

Sum({<MonYear, Prod={"=Aggr(Rank(Sum({<MonYear={'$(=MaxString(MonYear))'}>} Sales)),ProdType,Prod)<=5"}>} Sales)

This expresion make the problem solve.