COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Framework Manager => Topic started by: churchy on 18 Feb 2008 06:11:33 AM

Title: Count rows of a report
Post by: churchy on 18 Feb 2008 06:11:33 AM
Hi,
I am trying to count the rows of a report. I am creating a calculation item within FM with this expression:
count(DISTINCT [Business View].[Sales].[Sale_ID]  for report)

the problem is that this calculation shows the TOTAL number of records without taking into account that if my report has any filter its value is wrong... i mean, this value is static ,if i apply any filter this value is not refreshed.
How can i show the number of the rows in the report creating fhis formula in Framework Manager (not whithin the report)?.

I have also use "Count(Rows for report)" but it still doesnt work.
Title: Re: Count rows of a report
Post by: COGNOiSe administrator on 18 Feb 2008 09:25:34 AM
This type of count has to be done on the report itself. Create a second query which uses the first one as reference and count the rows there.

Sample report specification based GOSAR 8.2 attached.

Title: Re: Count rows of a report
Post by: churchy on 18 Feb 2008 12:05:04 PM
Thanks for yor solution!
Title: Re: Count rows of a report
Post by: platinne on 18 Feb 2008 03:29:14 PM
Hello,

Have you tried the 'prefilter' option in your statement?

count(DISTINCT [Business View].[Sales].[Sale_ID]  for report prefilter)



Patrice