COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: PatrikK on 11 May 2009 07:53:02 AM

Title: Rank issue
Post by: PatrikK on 11 May 2009 07:53:02 AM
Hey experts!

I have a report that shows sales on a range of products for current and past month. I want to rank on current month (1-10) and also show what rank the product had past month.

EX.

Product   Sales this month   Rank this month   Sales last month   Rank last month
Apples     22                      1                       17                     2
Bananas   20                      2                       20                     1
...
well you get the idea!

The problem I have is that the ranking for last month only takes into account this month's top-10 products. Pineapples, that sold 17 quantities this month (and ended up as #3), only sold 1 quantity last month ends up as #10 when it in fact really was #22! Crazy!  ;D

Thank you in advance!
Title: Re: Rank issue
Post by: Gollapudi on 26 May 2009 07:05:44 AM
Hi,

You can create two Rank data items for Current month and Previous month which includes expression like    Rank_Curr: Rank(Total([Sales] for [CurrMonth]))
        Rank_Prev: Rank(Total([Sales] for [PrevMonth]))

On top of it, have filter in you Query like Rank_Curr<=10

Thanks,
Gollapudi.