Area for people to learn more about current Qlik related job postings.
I want to get the time difference
how can i get it
i have Date&Time field like the below
can any one help me
10/18/2018 07:08:00 PM
You can use the function Interval( A-B, 'D hh:mm' ).
where A is the newest date, B is the oldest date and the thirth parameter is the format you has the result (Days, hours:minutes)
I guess you want the difference between rows
Something like below is what you may want:
DT_TABLE:LOAD [Date&Time], interval([Date&Time]-peek([Date&Time]),'D hh:mm') as timedeltaRESIDENT [Table]order by [Date&Time];
If you want to calculate the difference between one record and the previous record, do it in the script adding to each record a new field with the difference over the previous record.
Sort your table using your date field and use INTERVAL() and PREVIOUS() functions to add the new field.
Example: (imagine your date&Time field is called "Fecha")
NEW_TABLE:LOAD * ,Interval( Fecha - PREVIOUS(Fecha), 'D hh:mm' ) as differenceRESIDENT old_tableORDER BY Fecha DESC