COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => COGNOS 8 Administration => Topic started by: srinivaschukka on 02 Nov 2007 03:42:23 AM

Title: displaying "Record Count" in the header section of the report
Post by: srinivaschukka on 02 Nov 2007 03:42:23 AM
The below is the issue...

There is a requirement for displaying "Record Count"   in the header section of the report. This should be count of records displayed on the report output. We can put a count of any query item displayed on the output but this doesn't work as expected if there is a grouping applied on the report query items, also the 'Count(Rows for report)' doesn't yield a correct result due to the grouping.

could you please help me in finding the solution

Thanks
Title: Re: displaying "Record Count" in the header section of the report
Post by: shri on 04 Nov 2007 05:48:10 PM
1.   Open your report in Report Studio
2.   Select any data item from your query  (for example Quantity or Salesperson etc)
3.   In the Expression Definition of selected data item , select Functions, Summaries, and then  double-click count , and edit the expressionso that it looks like this:
             count([Quantity]for report)
4.   Click OK.
5.   Rename the data item to quantity_count.
6.   In the Page Explorer, on Page1, from the toolbox, add a calculation (layout) to the header.
7.   In the Expression Definition, drag quantity_count into the expression and then click OK.
8.   If desired, add a label for the count by adding a Text Item from the toolbox to the right of the quantity_count data item.  Enter text: 'Row Count: '
9.   Run the report.
Additional Step for Cognos 8
For the query calucation to have access to the value, we need to do two additional steps.
1.   Select the Page object, and set the Query property to the query that contains the dataitem
2.   Set the Properties property to expose the Quanity_count data item (by checking the box beside it).

good luck
Title: Re: displaying "Record Count" in the header section of the report
Post by: sunny bachan prasad on 01 Aug 2015 02:30:07 PM
There is a requirement for displaying "Record Count"   in the header section of the report. This should be count of records displayed on the report output. We can put a count of any query item displayed on the output but this doesn't work as expected if there is a grouping applied on the report query items, also the 'Count(Rows for report)' doesn't yield a correct result due to the grouping.

could you please help me in finding the solution

Thanks
Title: Re: displaying "Record Count" in the header section of the report
Post by: Nagendar on 03 Aug 2015 07:26:32 AM
Hi   srinivaschukka and sunny bachan prasad.

Try to place a singleton and try to change the "Aggregate Method" if you click on data item properties in the singleton.
or try with "Aggregate Function" property in the Singleton Query (data item if you open singleton Query). Also try Auto Group & Summarize property of Query.

hope this will help you bit.

Thanks
Nagendar
Title: Re: displaying "Record Count" in the header section of the report
Post by: bvk.cognoise on 07 Aug 2015 12:20:24 AM
HI srinivaschukka,

Please below mentioned method

For eg: We are using Product Line,Product Type,Product,Revenue in list i have applied grouping on Product Line,Product Type now create a new data item with following expression

running-count ([Product line])

Then add the newly created query item to the header .It should give you the result as expected .PFA xml fro reference.

Regards
Bvk