Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
johnan
Creator III
Creator III

Minutes between 2 times

Hi All!

I have 2 time colums and i want to calculate the minutes between this times:

08:00 between 08:45 should give me - 45 minutes
07:00 between 06:50 should give me + 10 minutes

Any way to do this?

1 Solution

Accepted Solutions
Not applicable

Replace 1440 by 24

Philippe

View solution in original post

12 Replies
Not applicable

Hi,

Use this expression to get a result in seconds:

round((TimeStamp1-TimeStamp2)*86400)

or to get a result in mins:

round((TimeStamp1-TimeStamp2)*1440)

Cheers

Karol

johnan
Creator III
Creator III
Author

Hmm, it doesent work.

The first column is a timeformat from Excel and called Levtime
Exampel:
Levtime 10:00

And the other isa timestamp but i have format this in the script time(Status) as [Statustime]

Statustime = 10:01:00
And the result of:
round((Levtime-Statustime)*1440) gives me: -57 571 201

Not applicable

Here is an example that works.

Philippe

johnan
Creator III
Creator III
Author

Okay, it's seems that my formating is wrong. But i works now.

How to format in HH?

Not applicable

Replace 1440 by 24

Philippe

johnan
Creator III
Creator III
Author

How to calculate 13:00 + 60 minutes = 14:00?

Not applicable

Hi,

it dependens on the underlying datatypes....

put this expression in the textbox and check how it works:

=time((num(time('13:00'))+1/24)) //to calculate 13:00 +60mins

cheers

Karol

johnan
Creator III
Creator III
Author

Hi, hmm this wont workSad

13:00 is a Datetime datatype and 60 is number. I want QV to calculate the above to 14:00 (13:00 + 60 minutes)

Not applicable

So what number is under 13:00 datetime value? Can you do num(YOUR_DATETIME_FIELD) and paste the value.

Cheers

Karol