COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: lookingforK on 13 Sep 2012 02:56:45 PM

Title: How to extract data for 2012 Quarter 1, Quater 2, and Quarter 3?
Post by: lookingforK on 13 Sep 2012 02:56:45 PM
Hi,

I am creating a list to extract data using Cognos Report Studio 8.

The columns in the list are:
Store   YTD Sales    Quarter 1 Sales   Quarter 2 Sales   Quarter 3 Sales
.......
.......
.......

I filtered the data with only 2012 months, e.g. Jan. ~ Sep in 2012.

I used the following expression for Quarter 1:
[color=red]if ([...].[Deal Dimension].[Month] in ('JAN', 'FEB', MAR')) then (total (Sales Count)) ELSE (null)[/color]

But I got the same values as those of YTD.

I am wondering:
* What expressions for Quarter 1, Quarter 2, and Quarter 3 I can use?
* Is there a WHERE Clause with Report Studio? (So I can use an expression like (total (Sales Count) where ([...].[Deal Dimension].[Month] in ('JAN', 'FEB', MAR')) for Quarter 1, and so on)


Thank you in advance.
Title: Re: How to extract data for 2012 Quarter 1, Quater 2, and Quarter 3?
Post by: tjohnson3050 on 13 Sep 2012 03:42:23 PM
Create a data item with an aggregation property set to total.

In the data item use a case statement:

case when ([...].[Deal Dimension].[Month] in ('JAN', 'FEB', MAR')) then (Sales Count) else 0 end

Create a similar data item for Q2 and Q3
Title: Re: How to extract data for 2012 Quarter 1, Quater 2, and Quarter 3?
Post by: lookingforK on 14 Sep 2012 09:34:41 AM
Thank you tjohnson3050,

It works.