Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Script difference timestamp calculation

Hi,

I load datas from a database, where there are several timestamps

example :

[Field 1] [Date/Time Departure 1] [Date/Time  Arrival 1],

[Field 2] [Date/Time Departure 2] [Date/Time  Arrival 2],

[Field 3] [Date/Time Departure 3] [Date/Time  Arrival 3], etc.

MyTable:

LOAD

Field,

DateDeparture,

DateArrival

Resident Table;

I want to add a field TimeStampDiff which is the lapstime in minutes between  [Date/Time Departure 2] and [Date/Time  Arrival 1], [Date/Time Departure 3] and [Date/Time  Arrival 2]

In general [Date/Time Departure n+1] and [Date/Time  Arrival n]

How can I do it in script ?

Thanks in advance for your help

1 Solution

Accepted Solutions
Not applicable
Author

Use the Previous or Peek functions to calculate the difference.

ArrivalTime - Previous(ArrivalTime)

Please post some sample source data so community will help more.

View solution in original post

2 Replies
Not applicable
Author

Use the Previous or Peek functions to calculate the difference.

ArrivalTime - Previous(ArrivalTime)

Please post some sample source data so community will help more.

Not applicable
Author

Thank you, it seems to work !

I'll try next time to add sources. Please see my other topic : Filter a table object with a calendar