COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: cognosehelp01 on 10 Nov 2014 11:03:15 AM

Title: Pull item once from grouping
Post by: cognosehelp01 on 10 Nov 2014 11:03:15 AM
Hey guys,

I'm having what I think might be a simple-fix issue (I hope).
Basically I am have a series of Discrepancy pages grouped by Discrepancy #. Each row within that Discrepancy # has Discrepancy Type and Corrective Action Descriptions.
Rows output as:
Discrepancy# - Discrepancy Type - Corrective Action Description
1 - 12 - Issue found
1 - 12 - Issue worked on
1 - 12 - Issue corrected
2 - 56 - Issue found
2 - 56 - Issue worked on
2 - 56 - Issue corrected

I want to get a count of the Discrepancy Types, but because it's repeated in every row I am getting a higher count than what's actually there.
How would I go about only pulling the Discrepancy Type once per grouping(Discrepancy #)?

Thanks!
Title: Re: Pull item once from grouping
Post by: Lynn on 10 Nov 2014 11:23:36 AM
If it is a relational package you could try the expression below with aggregation property set to none

count ( [Discrepancy Type] for [Discrepancy #] )
Title: Re: Pull item once from grouping
Post by: CognosAnalytics on 11 Nov 2014 12:22:22 PM
count (distinct [Discrepancy Type] for [Discrepancy #] )
would give you a Distinct count of Discrepancy Type Per Discrepancy #.