1 Reply Latest reply: Oct 13, 2010 12:06 PM by Gordon Savage RSS

    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!!


        • Getting duration of dates between two records
          Gordon Savage

          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.