Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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

Re: Script difference timestamp calculation

Use the Previous or Peek functions to calculate the difference.

ArrivalTime - Previous(ArrivalTime)

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

2 Replies
Not applicable

Re: Script difference timestamp calculation

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

Re: Script difference timestamp calculation

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