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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
svante
Contributor
Contributor

Calculating time diff in Qlikview

Hi, this q has not been answered in this forum but many people must struggle with this:

Q: how to calculate time diff in script?

Ex Calc time between 2 loops. This is how I do it. Any comments and risk with this? I notcied that neg values doesnt go well, so u have to check for that or trust the data.

Time(Time(departure_loop1) - (Time(arrival_loop1))) as Diff_Dep1_Arr1

I would appreciate a "TimeDiff" function!

Regards





Labels (1)
1 Solution

Accepted Solutions
Not applicable

Use the Interval() function

Interval(arrival_loop1 - departure_loop1, 'hh:mm:ss')

View solution in original post

3 Replies
Not applicable

Use the Interval() function

Interval(arrival_loop1 - departure_loop1, 'hh:mm:ss')

svante
Contributor
Contributor
Author

Big THX!! More elegant solution.

Yes

hubertdudek
Contributor III
Contributor III

This solution will crush when departure is exactly at midnight or after it as