COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: cabaynes on 01 Jul 2011 10:10:55 PM

Title: Insert a CASE Statement into a Concantenated Data Item? (Example inside)
Post by: cabaynes on 01 Jul 2011 10:10:55 PM
I have a data item in my query that looks like this:

[Name]||[SerialNumber]||[Status]

I would like to add a case statement to the end of the concantenation so the data item is then:

[Name]||[SerialNumber]||[Status]|| CASE when ... then ... when ... then ... else ... end

But when I attempt it I just get an error. I surrount the case statement with brackets, but I don't know what the proper code is. What do I need to surround the case statment with to get it to work? I have tried surrounding it with both [  ] and {  } brackets, but neither work.

Can anyone help on this holiday weekend?

Thank you and Happy 4th!

Charles
Title: Re: Insert a CASE Statement into a Concantenated Data Item? (Example inside)
Post by: mvn.balu on 02 Jul 2011 10:27:12 AM
HI
please try this formate i think u wil get

[gosales_goretailers].[Products].[Product line]|| ' '|| (case
when ( [Order month] between 1 and 8) then ([Retailer name]) else(' ') end)
Title: Re: Insert a CASE Statement into a Concantenated Data Item? (Example inside)
Post by: cabaynes on 02 Jul 2011 10:51:35 AM
Wow, I feel dumb! Surrounding the case statement with parentheses worked!

Thank you!  :) :) :)