COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: amit_pjoshi on 22 Jan 2014 03:55:07 AM

Title: Count function error
Post by: amit_pjoshi on 22 Jan 2014 03:55:07 AM
Hello Expert,

Can you please help me, I'm trying to get the user Count having training attended = Yes but getting error while parsing following code?

Count( distinct [AD].[USER_ID] for [Bug Tracker].[Attended] ='Yes')


Regards,
Amit J
Title: Re: Count function error
Post by: MFGF on 22 Jan 2014 05:25:02 AM
Hi,

This looks to me like SQL syntax? If you are coding this in a query calculation, you would either need to
a) Filter your query to just those rows with [Attended]='Yes' and use the expression count([AD].[USER_ID] for report)
or
b) Group on the [Attended] column and use the expression count([AD].[USER_ID] for [Attended])
which will give you a count for each value of Attended
or
c) Add a singleton (based on a new query containing [USER_ID] and [Attended]) and filter the query for this on [Attended] = 'Yes' and code the expression count([AD].[USER_ID] for report)

Cheers!

MF.
Title: Re: Count function error
Post by: amit_pjoshi on 22 Jan 2014 06:07:46 AM
Hi,  :)

Thank you so much for your quick response.

Regards,
Amit J