COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: koolbachi on 20 Jul 2012 04:29:53 AM

Title: Regarding Count Function
Post by: koolbachi on 20 Jul 2012 04:29:53 AM
Dear Cognos Folks,

I have a report in which I want to use count function in data item in keep 1 and property for dataitem as Count.

One scenario it works and other scenario it doesn't work:

Scenario 1:

I have four data item CD1,CD2, CD3 and Count1(Dataitem) in filter I included CD2 in 'xxx' and CD3 = 'yyy'

List is as below  seems to work .

CD1   CD2   CD3   Count1   
cc   xxx   yyy   3   
dd   xxx   yyy   4   
ff   xxx   yyy   18   
gg   xxx   yyy   25   

Scenario 02: Doesn't work as required when you see in count its only giving 1 all the rows.

The Filter in this report is CD2 in 'xxx'.

CD1   CD2   Count1
cc   xxx   1
dd   xxx   1
ff   xxx   1
gg   xxx   1


Note : CD3 is from different namespace and table.

how to get the correct count in scenario 2.

Thanks in advance

Regards
Gops

Title: Re: Regarding Count Function
Post by: tjohnson3050 on 21 Aug 2012 11:48:02 PM
Since CD3 is in a different table, when you don't include it in the list, that second table does not get joined in and included in the count.  Go to the 'properties' property and select CD3.  This will include it in the query without adding it to the list.