COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: wwconslt on 08 Apr 2014 11:10:49 AM

Title: Counting IDs that appear more than once in a report
Post by: wwconslt on 08 Apr 2014 11:10:49 AM
Hello Everyone,

Cognos Report Studio 10.1.1

I have a report with id number and first and last name.  with grouping on activity.  I would like to have another column that shows the count of how many times a person appears on my report.  Eventually I'd like to set conditional formatting so that if a person appears more than once, their row will be yellow.

Thank you for your help!
Title: Re: Counting IDs that appear more than once in a report
Post by: Lynn on 08 Apr 2014 11:47:40 AM
There are some good suggestions in this link  (http://www.cognoise.com/index.php/topic,24030.0.html) on how to provide sufficient details to get the best responses.

Is your package relational or dimensional? If relational then you can try creating a query item with an expression something like this:


count( [Last Name] for [ID] )


It isn't really clear to me how your grouping on activity pertains to the issue, but the general concept is to use the count function with the scope defined in the "for" clause.
Title: Re: Counting IDs that appear more than once in a report
Post by: wwconslt on 08 Apr 2014 12:30:29 PM
Thank you Lynn!  That worked perfectly (we have relational packages).  And thank you for the link.