Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Getting duration of dates between two records

I have a table with following fields:

id, ticket_no, ticket_date

where id is the primary key and ticket_no is the foreign key

so some records look like this:

201, 1200, 2010-03-13 12:05:44

203, 1200, 2010-03-13 17:12:04

205, 1200, 2010-04-12 14:12:23

204, 1205, 2010-04-23 13:23:34

and so on.

So what I need is the duration of the dates between the records, grouped by the foreign key, for e.g the duration between id 203 and 205.

I don't want to solve this case only on database sql level (where I know how to get this) for some reason.

I hope, I can get the data by Qlikview. Has anyone an idea howto handle this case?

What formula I have to use e.g. for an chart object.

I hope, I have explained well what I need. If there some questions, please ask.

Any help is welcome!!

Thomas

1 Reply
Not applicable
Author

Not sure I have understood correctly, but if you want to get the time difference between the ID and the preceding row ID you could load the data ordering it by ID then read the data back from the resident table and use 'peek' to retrieve TICKET_DATE of the row before, then use the returned value and the value of the current row to calculate the difference.

Regards,

Gordon