COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: GreekGod80 on 27 Aug 2008 04:20:09 PM

Title: Lag and Lead options
Post by: GreekGod80 on 27 Aug 2008 04:20:09 PM
Hi Guys,
I am trying to find a difference between 2 rows in a same column, I have tried using lag function (Cognos report under filters)it didnt work in Cognos, however it does work in SQL server....here is the example for a data

a                    new column
b       difference of 'a' and 'b' = 'c' hours

so if there is 300 rows of data there should be 150 differences.
Kindly Help ...Thanks in Advance
I also have another question if anyone of you know.....under the filters if we have red exclaimation mark, what does that suppose to mean ?
Thanks a Bunch
Title: Re: Lag and Lead options
Post by: blom0344 on 01 Sep 2008 09:14:06 AM
Did  you look at the running-difference  function?
Title: Re: Lag and Lead options
Post by: GreekGod80 on 05 Sep 2008 01:18:58 AM
Hi,
Thanks blom0344 for the reply. I have tried "running-difference" before my post, it worked well with the Number format. However, I have to use this option for a date formatted field.  ???.... In Cognos I am Getting usual difference in the following form.
21days 13Hours 24Minutes 12Seconds. (Running Difference is not working with that :() Kindly let me know how I can make this thing work, and what If I have to change the " 21days 13Hours 24Minutes 12Seconds" in a regular format like 1.603 which mean one sixth of a day .
Thanks in Advance, Your help will be highly appreciated :)