COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Report Studio => Topic started by: bonniehsueh on 30 Mar 2009 10:51:28 PM

Title: How to create MTD and YTD together in a List?
Post by: bonniehsueh on 30 Mar 2009 10:51:28 PM
I have created 2 queries.
MTD: Query 1 filtered on the [selected month]
YTD: Query 2 filtered on <= [selected month]

Now, how do I merge these queries into one query so they can show in one list? I've tried unioning them, but I get multiple lines for each variation of the union and I'm not sure how to only show the correct combination.

I also tired to join it based on a row id, but the numbers was compeltely off.

I also searched on Cognoise and found multiple posts but non exactly want I'm looking for.

Any help is appreciated.

Thanks in advance!
Title: Re: How to create MTD and YTD together in a List?
Post by: Manic on 13 Apr 2009 07:58:46 AM
Hi Friends,

instead of using filter for both MTD and YTD calculations.We use it in data items with the help of the CASE Statement.

e.g.
case when month= cal.month then 'measure' else 'none' end.

apply for both YTD and MTD.
Title: Re: How to create MTD and YTD together in a List?
Post by: yasarayhankaya on 10 Jun 2009 03:49:26 PM
Hi,
I am new to cognos, so this may not be the most challanging question but I need to know, ???
when you say you use it in the data fields, what do you mean by that, do you add this statement to the expression definition or somewhere else
thanks,
Yasar