COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: satishsure on 07 Mar 2016 02:16:27 AM

Title: previous row value for comparison
Post by: satishsure on 07 Mar 2016 02:16:27 AM
I need to compare the previous row value for one column.Database is Db2 and its relational type.

Below is the condition in BRIO..We need to use the function below and need to update in Cognos
--------------------------------
BRIO condition for the column:
if (ProdTYPE] = "CONT"  And @[Flag] ="Y"  AND  (prior ('ProdTYPE')  = "LEASE" )) Then
Prior ( Amount) }  else {Amount }
--------------------------------
How to fetch previous row value in Cognos?

Title: Re: previous row value for comparison
Post by: Gopinath on 07 Mar 2016 05:18:32 AM
you need to create 2 queries

Query1: with running-count(rows) and
Query 2: with running count(rows)-1

Create an outer join on Query 2 on running-count data items
Title: Re: previous row value for comparison
Post by: satishsure on 07 Mar 2016 07:01:13 AM
How to get the previous row value
Title: Re: previous row value for comparison
Post by: BigChris on 07 Mar 2016 07:45:33 AM
See Gopinath's reply