COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: HigherEdCognosGuru on 24 Oct 2017 09:07:38 AM

Title: Year over Year Change
Post by: HigherEdCognosGuru on 24 Oct 2017 09:07:38 AM
I am creating a report that has 10-years of history. I would like to compare say 2015 measures to 2016 and determine the variance and calculate the variance and consequently do the same to 2016 to 2017 and so on.  If memory serves me correctly, you have to create a union to do this, but I can't find the exact article. Any assistance is greatly appreciated.
Title: Re: Year over Year Change
Post by: New_Guy on 24 Oct 2017 09:38:26 AM
Hi,
Did you try using running-difference?
1st column in the list will be year sorted ascending, 2nd column will be the measure, and the 3rd column will be a calculation  running-difference([measure]). Let us know if this solves your issue or not.
Good luck
New guy
Title: Re: Year over Year Change
Post by: venkat01 on 24 Oct 2017 02:00:03 PM
I would creat dataitems one is for current year 2017 as case when date>=trunc(current_date,'YY') and date<=current_date then measure end
second is for prior year 2016 as case when date>=trunc(_add_years(current_date,-1),'YY') and date<=_add_years(current_date,-1) then measure end
third is for prior-1 year 2015 as case when date>=trunc(_add_years(current_date,-2),'YY') and date<=_add_years(current_date,-2) then measure end
and so on
now you can compare year over year differences you can apply conditional formatting whether current year is red or green


Sent from my GT-N8000 using Tapatalk