COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Framework Manager => Topic started by: zaib on 17 Jan 2014 07:59:14 PM

Title: case expression
Post by: zaib on 17 Jan 2014 07:59:14 PM
I am using case expression in a query item but my expression return 2 values, seems like else is working even though I do not use else in my expression.

case when ([Transformation View].[General & Adminsitration].[Key Part 2] = '4') then ([Transformation View].[General & Adminsitration].[Key Part 2]) end

((see attachment))

Here is what I am trying to do may be there is a better way::I am new to FM and I am trying to build a query subject which will have filters for each query item. if I add filters to query subject then it applies to whole query subject  which I do not want... Another approach I am thinking but have not tried yet is to split these query items in its own query subject and then merge all them in new query subject.

Any help is appreciated.

Thanks,
Zeek
Title: Re: case expression
Post by: charon on 17 Jan 2014 08:28:05 PM
hey zeek...
could you pls explain the goal you want to achieve in another way?
QuoteHere is what I am trying to do may be there is a better way::I am new to FM and I am trying to build a query subject which will have filters for each query item

So you want a query item (e.g. [Time]) with different filter for attributes ([month] has different filter then [year]). whats the idea behind that? I would like to help, but i first have 2 understand your requierement ;)
cheerz [/quote]
Title: Re: case expression
Post by: zaib on 21 Jan 2014 02:01:35 PM
Thanks Charon. I will break my question into two parts
Part 1
I have a requirement to create a specific financial package for some executive reports.
The acct query subject is
Acct id, Acct Description,Acct Part 1, Acct Part 2, Rpt 1, Rept 2,....
Acct Part 1,Rpt 1, ... all these are different groups of acct id.
My requirement is that I need Gift Revenue which is Acct Part 1 value 200 and Rept 2 = 1 so in order to accomplish this I create a query subject acct and created query item Gift Revenue using case for the filter but this brings 2 values back.
How do I tackle such query subject? Do I make separate query subjects for each like Gift Revenue, Contract Revenue,... and then merge query subject or some other better way?

Part 2
My source saves actuals in different columns, month1, month2,..month12 so in order to make it dynamic I used case statement same issue it bring out 13 months (1 extra). How do I tackle this one?
Title: Re: case expression
Post by: zaib on 22 Jan 2014 12:48:43 PM
Let me know if I am not making any sense? I am new to FM.
Title: Re: case expression
Post by: charon on 23 Jan 2014 03:58:19 PM
Hi Z-Cog,
i have written you an email some days ago.
It would help if you could post a FM-Diagramm of a simple sketch/drawing of your metadatamodell with the relevant attributes, tables and join paths.
Also, maybe a crosstab of your requierement, what you want to achieve.
Im sry, but im a men of visualizations ;)

Thx a lot, have a nice evening
br charon
Title: Re: case expression
Post by: zaib on 28 Jan 2014 10:42:50 AM
Thanks Charon, I was out of town. I will get a visual uploaded shortly.
Title: Re: case expression
Post by: zaib on 28 Jan 2014 11:13:26 AM
Attached is the visual. Now I have two questions.

1) How do I approach with key query subject.
2) How do I approach the actual as each month has its own bucket.

Title: Re: case expression
Post by: zaib on 29 Jan 2014 12:30:03 PM
Any pointer will be highly appreciated. I am new to FM