COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Topic started by: tinas on 26 Jun 2007 07:32:06 AM

Title: Report Studio 8.2 Is there a simple way to restrict the list of results to, for
Post by: tinas on 26 Jun 2007 07:32:06 AM
Hi all -

Is there a simple way to restrict the list of results to, for example, 100 account numbers?  I'm not looking for a ranking; just want to return a list of 100 account number.

Thanks for your help!


Title: Re: Report Studio 8.2 Is there a simple way to restrict the list of results to, for
Post by: sir_jeroen on 26 Jun 2007 10:54:40 AM
what are you trying to accomplish? Does your result set only need to return 100 acc numbers or does it have to be based on 100 acc numbers?
Title: Re: Report Studio 8.2 Is there a simple way to restrict the list of results to, for
Post by: tinas on 27 Jun 2007 07:37:57 AM
This particular report only needs to return 100 acc numbers.  There are times when the researchers will want the report to return a set of 100 random records.
Title: Re: Report Studio 8.2 Is there a simple way to restrict the list of results to, for
Post by: sir_jeroen on 27 Jun 2007 05:07:03 PM
you could specify in your Query Subject in FM only to use 100 records... 
For SQL Server:
select top 100 * from tableX
For Oracle:
select * from tableX where rownumber <101
For DB2:
???? :D

If it's only for 1 report you could try adding a filter like "Rownumber() < 101" to your query