COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: damzI on 17 Nov 2016 09:59:18 AM

Title: Function to get the month from the date dimension using a cube
Post by: damzI on 17 Nov 2016 09:59:18 AM
Hello All,

So I am creating a report using a cube. I need to extract the month from the date dimension. My month cation looks like YYYY/mmm (eg 1996/Apr). Any ideas on how to get only the month from above. Have tried to recast it to a sting and then use substring (I can only get the year but not the month). Also have tried the 'Extract' function - both don't work...

Thanks, D
Title: Re: Function to get the month from the date dimension using a cube
Post by: damzI on 17 Nov 2016 10:11:14 AM
Never mind - manage to get it using the CAST function...

cast ([CubeName].[Date].[Date].[Month] -> ?RM?, VARCHAR(10), 6)

Thanks ! - D