COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: cognos05 on 29 Jan 2015 08:43:17 AM

Title: comparing tuple value in case gives parsing error
Post by: cognos05 on 29 Jan 2015 08:43:17 AM
Hi All,

I am using the below statement in my case condition.

tuple(item([Last6Months],0),currentMember([Sales].[Shipped Customer].[Customer]),[Qty])
this statement when executed separately displays the correct value.

when used like

case when (tuple(item([Last6Months],0),currentMember([Sales].[Shipped Customer].[Customer]),[Qty])<>0)
Then (1)
Else (0)
End

gives me parsing error .

Thanks,
Nithya
Title: Re: comparing tuple value in case gives parsing error
Post by: bdbits on 29 Jan 2015 11:46:40 AM
I think you need a value() function, something like:

case when (value(tuple(item([Last6Months],0),currentMember([Sales].[Shipped Customer].[Customer]),[Qty]))<>0)
Then (1)
Else (0)
End
Title: Re: comparing tuple value in case gives parsing error
Post by: cognos05 on 29 Jan 2015 01:44:19 PM
Hi,

Getting the below error when used value

Error : Getting Invalid coercion from measure to Hierarchy