COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: LOUM on 07 Nov 2011 12:45:15 PM

Title: Simple Ranking
Post by: LOUM on 07 Nov 2011 12:45:15 PM
ok this is driving me nuts!     :o

List report.
Rank([QTY])

Why are my results skipping numbers (Ranks)?

Data looks like this when it runs.
Rank - Qty
1 - 117
2 - 95
3 - 92
3 - 92
5 - 89
5 - 89
6 - 85
6 - 85
6 - 85
Title: Re: Simple Ranking
Post by: blom0344 on 07 Nov 2011 03:13:56 PM
ties yield equal ranks
Ye average modern database has a dense_rank function to eliminate gaps,which would yield:

1 - 117
2 - 95
3 - 92
3 - 92
4 - 89
4 - 89
5 - 85
5 - 85
5 - 85
Title: Re: Simple Ranking
Post by: LOUM on 07 Nov 2011 03:26:39 PM
Blom,

Thank you for the reply, unfortunately it is slightly greek to me. Is dense_rank a correct function in C8?? or is it another function. If I am understanding you correctly it would be written like like this

dense_rank([QTY])

Thank you!
Title: Re: Simple Ranking
Post by: blom0344 on 07 Nov 2011 03:44:07 PM
Cognos supports the use of native functions (make sure you enable them in the package def). The latest database versions support dense_rank() function, but you need to try and find out if thse can be used from within Cognos
Title: Re: Simple Ranking
Post by: LOUM on 09 Nov 2011 12:49:34 PM
Thank you everyone for your wonderful support.

Lou