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: 
ah009
Contributor II
Contributor II

difference between timestamps

hi trying to find the difference between this 2 timestamps

09/10/2021 17:17
24/06/2021 13:56
02/08/2021 09:46

 

09/10/2021 16:18
24/06/2021 12:53
02/08/2021 08:42

first completion date 

second is created date

want to find the time difference between both

Labels (4)
1 Solution

Accepted Solutions
ah009
Contributor II
Contributor II
Author

thank you.
exactly what i need 

View solution in original post

5 Replies
Or
MVP
MVP

[Created Date] - [Completion Date]. Generally speaking, you can subtract dates or timestamps to get the difference between them.

vchuprina
Specialist
Specialist

Hi,

You can use the interval function

https://help.qlik.com/en-US/qlikview/May2021/Subsystems/Client/Content/QV_QlikView/Scripting/Formatt...

Example:

I use Timestamp# funtion to recognize string as a timestamp.

After this I use Interval function, it allows to find difference in a different formats ('d' - day,  'hh:mm'- hours and minutes, etc.)

Data:
LOAD
*,
Interval(Date1-Date2, 'hh:mm') AS Diff
;
LOAD
Timestamp#(Date1,'D/M/YYYY hh:mm')AS Date1,
Timestamp#(Date2,'D/M/YYYY hh:mm')AS Date2;
LOAD * Inline[
Date1, Date2
09/10/2021 17:17,09/10/2021 16:18
24/06/2021 13:56,24/06/2021 12:53
24/07/2021 12:01,24/07/2021 05:10
02/08/2021 09:46,02/08/2021 08:42
];

Result:

vchuprina_0-1650448759073.png

 

Regards,

Vitalii

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").
ah009
Contributor II
Contributor II
Author

Thank you, 

ah009
Contributor II
Contributor II
Author

thank you.
exactly what i need 

vchuprina
Specialist
Specialist

Welcome🙂

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").