Tuesday, August 12, 2008

OBIEE Difference between two rows

Found this one on the OTN Forum:





Handy when your database doesn't have a Lag or Lead function

Till Next Time

1 comment:

crspycrtr said...

I am looking to do something similar to this but I just can't wrap my head around it.

I have a table with 5 columns and I'm adding a 6th as a duration calculation. C1 Ticket_ID, C2 Sequence_ID, C3 Sequence_Number, C4 Date_Crated, C5 Resolved_Date and C6 Duration

C1 is the main ticket ID and C2 are sub-tickets of the main ticket. C5 is only populated with a date when the main ticket is resolved. So in C6 I need to do a calculation from C4 of the first sub-ticket to the next sub-ticket(sequence 1 to sequence 2, etc.) if C5 is null and then if C5 is not null do a calcution between C4 and C5.

Any help would be greatly appreciated.