COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: cham on 21 Jan 2012 12:28:53 PM

Title: monthly average calculation in cognos
Post by: cham on 21 Jan 2012 12:28:53 PM

Hello Gurus,

I have a crosstab report. I want to create a metric A which has the following calculation :

Average A : Jan = (prev dec +jan)/2
                   Feb = (jan + feb)/2
                   .
                   .
                   .
                  Dec = (nov+dec) / 2
                  YTD = prev dec+Jan+Feb+mar+.....upto YTD month(which is a prompt in my report)/no of months

My model is a DMR. I am getting the point how to calculate the monthly average where I have to grab the previous month and calculate it and store it , so that I can use it in another calculation.

This is one layer of calculation. After calculation Average A, I want to use these values to a second layer of calculation which is a percentage calculation  like B = (sC / Average A).

I am facing problem even creating Average A which is the denominator in the main calculation. Please help me in this regard.

thanks in advance!