COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: dsallow on 09 Apr 2010 07:54:57 AM

Title: Top N Reporting
Post by: dsallow on 09 Apr 2010 07:54:57 AM
I am wanting to create a report where I break my data down by number of incidents within a group.  I then only want the top 10 groups to be displayed on a graph.  I am using Report Studio 8.4.  What am I missing in doing a top n report.
Title: Re: Top N Reporting
Post by: rockytopmark on 09 Apr 2010 10:28:13 AM
We don't know what you have tried, so help us understand your situation better. That said, here are some Basics:


Good luck.... M
Title: Re: Top N Reporting
Post by: dsallow on 09 Apr 2010 11:38:49 AM
Thank you so much.  I am using a relational model.  I am coming from crystal where top n existed as a reporting option so i never thought of the rank().  I am going to try that., ;D
Title: Re: Top N Reporting
Post by: blom0344 on 09 Apr 2010 01:14:26 PM
It may be trickier that the examples given. If your resultset is based on an aggregate, then you will find that rank() is established prior to aggregation and the values are pretty meaningless (since they do not apply to the ultimate grouped rows)

In SQL terms this would mean having an inline view that stores the outcome of the aggregated set and a second select to apply the ranking to the individual groups..