COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: mohini7 on 03 Nov 2009 01:04:42 PM

Title: How to get Previous month value in calculation
Post by: mohini7 on 03 Nov 2009 01:04:42 PM
Hello All,

i have a list report, in i


Period        Network    WPG                           WIG
---------    -----           -------------                ------------
2009-06   XIO   154,015,334   67,863,564
2009-07   XIO   154,744,222   64,475,495
2009-08   XIO   143,432,417   69,582,847
2009-09   XIO   154,528,535   72,613,258


how can i calculate PPO

calculation formula is  (WPG - WIG) / Previous Month WIG * 30

for example: 2009-09  ppo will be  (154,528,535 - 72,613,258) =  81,915,278
               then 81,915,278/ 69,582,847 = 1.177
               1.177 * 30 = 35.317


so here the tricky thing is how to get previous month WIG value in the calculation, i have tried much time, please i need another brain to work on

Please Help me

i great full to all of you

thanks in advance

mohini
Title: Re: How to get Previous month value in calculation
Post by: mohini7 on 03 Nov 2009 01:30:22 PM

Any one please help me

any ideas at least please


Mohini
Title: Re: How to get Previous month value in calculation
Post by: mohini7 on 03 Nov 2009 02:24:43 PM
is it possible at least

please

mohini
Title: Re: How to get Previous month value in calculation
Post by: mohini7 on 03 Nov 2009 07:32:10 PM
Can Any One please any ideas.............
Title: Re: How to get Previous month value in calculation
Post by: mohini7 on 03 Nov 2009 07:52:42 PM
Please any ideas

Thanks in advance
Title: Re: How to get Previous month value in calculation
Post by: vinu on 03 Nov 2009 11:09:56 PM
Hi

just try with below thought.

Create one calculated data item to get Previous month WIG data and divide with that.

last month WIG = If (period=ADD_MONTHS(sysdate,-1)) then 'WIG' else '0'

Thanks,
Venu
Title: Re: How to get Previous month value in calculation
Post by: bloggerman on 09 Nov 2009 11:27:36 PM
Ideally, there should be another column which has the previous month number in it loaded through ETL process.

Else, a workaround could be to build a separate query and join it with the existing main query. You can join such that the previous number comes at the same row.