COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: kgcognos on 05 Dec 2014 11:31:44 AM

Title: Calculate Year difference
Post by: kgcognos on 05 Dec 2014 11:31:44 AM
I have 2 value prompts.
1-  Fiscal Month/Year Prompt [ie ... January, 2014.. February, 2014...]
2-  Compare Sales to Year Prompt  [ie  2013, 2012, 2011 ...]   

How do I get the year difference between the 2 prompts?
If I select January 2014 and compare it 2012, my [CompYearDiff] should be 2 so that I can use it in parallerPeriod function:

( parallelPeriod ([Sales Cube].[Fiscal Time].[Fiscal Time].[Year],[CompYearDiff],[Selected Month]) ) 

Thank you in advance.
Title: Re: Calculate Year difference
Post by: kgcognos on 08 Dec 2014 09:01:14 AM
How can I make this statement work? I need to get the # of years in between. 
ancestor([Selected Month],2) - ?CompYear?

The [Selected Month] is like January, 2014....
?CompYear? is 2013...

Thank you
Title: Re: Calculate Year difference
Post by: kgcognos on 10 Dec 2014 04:16:58 PM
what's the equivalent of "_years_between" function when using dimensional cube?