COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: barrysaab on 23 Mar 2011 11:01:31 AM

Title: Two years of Simultaneouly
Post by: barrysaab on 23 Mar 2011 11:01:31 AM
I have requirement such that if an user select current year for ex 2010 ,the report should display both current year as well as previous simultaneously.Thanks for your help
Title: Re: Two years of Simultaneouly
Post by: NimrodA on 23 Mar 2011 01:04:11 PM
Cube or Relational?
Title: Re: Two years of Simultaneouly
Post by: barrysaab on 23 Mar 2011 10:14:05 PM
Thanks,It is dimensional data.
Title: Re: Two years of Simultaneouly
Post by: ammuk on 23 Mar 2011 10:54:23 PM
use with filter expression as
year in (?p?,?p?-1)
or u can cast the year to integer and apply it
regards
ammu
Title: Re: Two years of Simultaneouly
Post by: barrysaab on 23 Mar 2011 11:10:56 PM
Thanks,I did try exactly what you have mentioned above,unfortunately getting data error,i even tried to cast the year but to no avail.Thanks again.
Title: Re: Two years of Simultaneouly
Post by: RobsWalker68 on 24 Mar 2011 05:39:29 AM
Hi,

Is the requirement to display for example year 2010 as well as 2009 as seperate items?

If so can use dimensional functions such as lag or parrallelperiod to do this:

Selected Year: [Cube].[Dimension].[Hierarchy].[YearLevel] -> ?pr_year?

then use the dimensional functions

Lag([SelectedYear,1) or parallelPeriod ([cube].[Dimension].[Hierarchy].[YearLevel],1,[SelectedYear])

If you are looking for a total of two years instead then you can just aggregate both together.

Rgds

Rob