COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: shivani_cog on 07 Dec 2011 11:35:45 AM

Title: date format
Post by: shivani_cog on 07 Dec 2011 11:35:45 AM
Week of the year = [Sales].[Time].[Date].[Week].[Week of the Year]
Week Number = CASE WHEN
(?time_range?='Begin & End Date') AND
( ([Sales].[Time].[Date].[Date].[Date]) between ?Begin_date? AND ?end_date?) 
THEN ([week of the year])
ELSE 0
END
Error : Incompatible data types in case statement.
how do I fix it ?
Title: date format
Post by: MFGF on 07 Dec 2011 03:32:36 PM
By the looks of things, Week of the year is a MUN pointing to a specific member in your cube? If this is the case, you are using a different data type altogether when you try to substitute the integer 0 into your expression with the case statement.

Regards,

MF


Snet form my fumblefingers
iPhon 5 usig Tapatalk
Title: Re: date format
Post by: shivani_cog on 08 Dec 2011 01:52:59 PM
Hi MFGF,
Thanks for your answer.
Where do I put 0?
Title: Re: date format
Post by: HalfBloodPrince on 08 Dec 2011 10:20:40 PM
Instead of 0  try to return  null or just put ''