COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Sarayucog on 12 Dec 2011 07:44:33 AM

Title: How to find out the Prvious value in a dataitem
Post by: Sarayucog on 12 Dec 2011 07:44:33 AM
Hi All,

I have a list like below.

Sno Revenue  Revenue%

1    100
2    200
3    300
4    400
5    500
6    600

Actually my requirement is (Previous Revenue / Current Revenue). Means

As per the formula EX1: (200/100) = 2
         EX2: (300/200) = 1.5
         EX3: (400/300) = 1.333

Like this we have to find out the Revenue%. For this we have create a data item to hold Previous values. In the example 1 100 is Previous value , in EX2 200 is Previous value and EX3 Previous value is 300.


Thanks in advance
Title: Re: How to find out the Prvious value in a dataitem
Post by: pricter on 12 Dec 2011 08:25:38 AM
Create two queries and join them id from the one query and by the id minus one from the other one.

So in the third query item that it would be created by the join of the two queries you will have side by side
the current and the previous values so to perform your desire calculation