Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calculation based on previous and current record in cognos

Status
Not open for further replies.

mikiap

MIS
Nov 27, 2003
27
CH
Hi all

Is there any function (or way to do it) that would return the previous record values while I am reading the current record?
I need to do a calculation = previousrecord.field1 - currentrecord.field1?
any ibm support/tips&tricks document existing to give me some ideas on this?

Thanks
Cheers
Anca
 
If you are using a relational package, then Cognos uses SQL to fetch the data. SQL is a non-procedural language where the concept of previous record is not really implemented.
With dimensional data this is simpler as you can use lag() / prevMember() functions.

In some cases it is possible to use 2 queries (2 sets of data) with the index value of the second set diminished by 1.
Rejoining this sets in the report of the index fields then allows you to perform the calculation on the resulting record. However , this only works with a returned set that has a continous index on it (like a counter or date)


Ties Blom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top