0

I am trying to implement a nested CASE in Cognos. Here is my code,

case 

when ?Radio Button for selection? = 'Y' 
then (substring( cast ([TN_Base_Views].[TktCoupon].[CouponStatusChangeDate], VARCHAR(10) ), 1, 7))

when ?Radio Button for selection? = 'M' 
then (substring( cast ([TN_Base_Views].[TktCoupon].[CouponStatusChangeDate], VARCHAR(10) ), 1, 3))

when ?Radio Button for selection? = 'Q' and substring(cast ([TN_Base_Views].[TktCoupon].[CouponStatusChangeDate], VARCHAR(10) ), 1, 3) contains ('01', '02', '03') then 'Q1'

when  ?Radio Button for selection? = 'Q' and substring( cast ([TN_Base_Views].[TktCoupon].[CouponStatusChangeDate], VARCHAR(10) ), 1, 3) contains ('04', '05', '06') then 'Q2'

when  ?Radio Button for selection? = 'Q' and substring( cast ([TN_Base_Views].[TktCoupon].[CouponStatusChangeDate], VARCHAR(10) ), 1, 3) contains ('07', '08', '09') then 'Q3'

when  ?Radio Button for selection? = 'Q' and substring( cast ([TN_Base_Views].[TktCoupon].[CouponStatusChangeDate], VARCHAR(10) ), 1, 3) contains ('10', '11', '12') then 'Q4' 

end

I am getting a parsing error on Validating the code. Please help me.

laylarenee
  • 3,276
  • 7
  • 32
  • 40
Ashish B Sathish
  • 121
  • 2
  • 4
  • 16

1 Answers1

1

I used "IN" instead of "CONTAINS"

Ashish B Sathish
  • 121
  • 2
  • 4
  • 16