COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: cognosbi.dwh on 08 Aug 2013 04:07:47 AM

Title: How to create YTD by using Dimensional Functions in Cognos
Post by: cognosbi.dwh on 08 Aug 2013 04:07:47 AM
Hi,

I have Year Hierarchy in Time Dimension, I want to show data for selected Year
For example, If I Run the Report in August & I selected the Year 2013 then I want to get data from Jan 2013 to Aug 2013
If I select the Year 2012 then I want to get data from Jan 2012 to Aug 2012

If I run the Report in next month i.e., September & I selected the year 2011 then I want to get data from Jan 2011 to Aug 2011

For Year selection I created below DataItem, it's working fine for me
.
Tuple ([Sales].[Time].[Year]->[All].?Year?,[Revenue])

I created Other DataItem SelectedMonth as

[Sales Analysis].[Time].[Month]->?Month?

Using above I created below DataItem as

periodsToDate([Sales Analysis].[Time].[Year].[Year],[Selected Month])

Here am getting the error

Can anyone suggest how to do same for YTD

Thanks,
SSR
Title: Re: How to create YTD by using Dimensional Functions in Cognos
Post by: MFGF on 08 Aug 2013 05:49:24 AM
Hi,

The periodsToDate() function expects the level and the member to be in the same hierarchy. In your case it looks like you have separate dimensions for year and month? Does your Month dimension have an All Months level? You should probably use this if so.

Cheers!

MF.