Friday, February 25, 2011

How to count only certain data in Cognos Report Studio?

Sometimes a count needs to be made on data that needs to meet certain requirements.
There are several ways to accomplish this. Here are two examples.


Example 1:

COUNT ( IF ( [FrameworkField] <= 2700 ) THEN (1) ELSE (0) )



Example 2:

CASE WHEN ( [FrameworkField] <= 2700 ) THEN (1) ELSE (0) END


Put either of these in a 'data-item'.
You can now use it in a list and do a Total on it.

Tuesday, February 15, 2011

How to strip the time from a date_time in Cognos Report Studio

Edit the definition of the date/time field in Framework Manager.

cast( [field in framework] as DATE )