COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: jahnavi on 13 Jun 2008 05:56:43 AM

Title: Regarding the display of value
Post by: jahnavi on 13 Jun 2008 05:56:43 AM
Hello friends,

Struck up with a very small doubt

I want to display the Revenue only if order year=2004 and quantity only if order year=2005 in the same list

If am using filter it is showing errors

Can any onbe pls help me in this
Title: Re: Regarding the display of value
Post by: blom0344 on 13 Jun 2008 06:22:54 AM
If your rows store both revenue and quantity for a given year, then applying a filter will not work.
Use a union construction (2 queries) and use a third one to display the result, like:

1st query :


SELECT 'Revenue_type',YEAR,REVENUE,0 FROM TABLE WHERE YEAR = 2004


2ND QUERY:


SELECT 'Quantity_type',YEAR,0,QUANTITY FROM TABLE WHERE YEAR = 2005

Title: Re: Regarding the display of value
Post by: jahnavi on 13 Jun 2008 07:00:53 AM
got it

thank you very much
Title: Re: Regarding the display of value
Post by: Venu_Gollapudi on 23 Jun 2008 08:52:01 AM
Instead of 2 diff Queries you can simply use the 'Filter ' function inside the data item and can Get it

for example:
You said
QuoteI want to display the Revenue only if order year=2004
[/b]

here what you can do is, open the data item and edit the exp like
filter([Revenue],[Year]=2004)

and
Quotequantity only if order year=2005
[/b]

The same thing you can apply here also, this will works out.
Title: Re: Regarding the display of value
Post by: jahnavi on 23 Jun 2008 11:04:50 PM
Hi,

I can acheived this using the conditional block.

Thanks for all your support

Jahnavi