COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Framework Manager => Topic started by: bioCam on 12 Aug 2010 11:22:18 AM

Title: Running-Count or Count with Expression
Post by: bioCam on 12 Aug 2010 11:22:18 AM
Hi, I am adding New Query Items 'RC-Complaint_1', 'RC-Complaint_2', 'RC-Complaint_3' to the Query Subject. 

'RC-Complaint_1' --> count the number of occurences of Complaint Type with data value 1 for that customer.  My scope is both the Customer and where the Complaint Type = 1

'RC-Complaint_2', 'RC-Complaint_3' would be for Complaint Type = 2 and 3 respectively.

In my expression definition:-

running-count( 0 for Customer,  Complaint Type] =1)  ---> the syntax I think is wrong and is not working for me.  I am not getting much luck searching for examples.  Would anyone know a solution?  Thank you.
Title: Re: Running-Count or Count with Expression
Post by: blom0344 on 16 Aug 2010 02:30:31 AM
A running-count is used for a different purpose. Normally the expression would be something like:


CASE
WHEN
Complaint Type = 1
THEN 1 ELSE 0
END


Set the aggregate to sum and then use both the customer and this new fact into the report