COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: keating101 on 03 Aug 2013 03:17:11 AM

Title: Need help with a WHEN function
Post by: keating101 on 03 Aug 2013 03:17:11 AM
Hello All

I have a report which i want to filter data by two transaction types, lets say "apples" and "oranges". i have done this part.

i then need to put another line of code in to say, when transaction type = apple, then only filter for colour = "green apples"

this is the code i have come up with, but i cant get it to work:
case
when[Trans Type Code] = 'APPLE'
THEN [Colour]=('Green')

Any body know a solution?

thanks in advance

Shaun
Title: Re: Need help with a WHEN function
Post by: Ammus1234 on 03 Aug 2013 01:31:08 PM
Try this filter.
([Trans Type Code] = 'APPLE' and [Colour]=('Green')) or ([Trans Type Code] = 'orange'
and [Colour]=('Orange'))
Title: Re: Need help with a WHEN function
Post by: keating101 on 03 Aug 2013 07:09:39 PM
Thankyou mate that worked!