COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: cognos05 on 13 Feb 2015 02:50:33 PM

Title: Ranking nested rows
Post by: cognos05 on 13 Feb 2015 02:50:33 PM
I have a Region and then EMployees under the region.

My column rank has the expression
Rank(currrentMeasure within set(Employees))

this ranks my all employees across all regions. I wan them to rank employees between their regions.

How should my expression look like,

Thanks,
Nithya

Title: Re: Ranking nested rows
Post by: cognos05 on 15 Feb 2015 10:14:54 PM
Now the ranking is done based on  employees with all regions. But since I have nested employees under region.i wanted to rank the employees with respect to each region. can you guys let me know how to achieve this ..

thanks,
Nithya
Title: Re: Ranking nested rows
Post by: bdbits on 17 Feb 2015 10:20:23 AM
I am pretty sure you need to change your expression from using set(Employees) to the set() corresponding to the region.
Title: Re: Ranking nested rows
Post by: cognos05 on 20 Feb 2015 07:28:43 AM
I did that and its not working.
Title: Re: Ranking nested rows
Post by: MFGF on 23 Feb 2015 05:43:24 AM
Quote from: nithya1224 on 20 Feb 2015 07:28:43 AM
I did that and its not working.

What does "its not working" mean?

MF.
Title: Re: Ranking nested rows
Post by: cognos05 on 23 Feb 2015 08:48:40 AM
Hi MFGF,
its not ranking it based on the employees with in regions.
IBM suggested the below code
rank(rank(currentmeasure within set ([Employee])) ASC for [Region])
but even this would work if I have only column and a measure.

Say if I have two columns like ytd and pytd and apply this then rank would not work.

WOuld not work is result being some random numbers ranked.

Thanks,
Nithya