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

get the minutes between two times

Hello!

Probably an easy one, I have two times, 08:30 and 08:40 and want to get the minutes between, 10 minutes in this case. How ca I calculate that in an expression?

Best regards

Mårten

1 Solution

Accepted Solutions
MarcoWedel

(Time2-Time1)*1440

View solution in original post

9 Replies
MarcoWedel

(Time2-Time1)*1440

senpradip007
Specialist III
Specialist III

Use interval( A-B, 'mm' ) where A = 08:40 and B = 08:30 will return 10.

PrashantSangle

Hi,

USe interval()

like interval(time2-time1,'hh:mm')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

=Interval(Timestamp#('08:40', 'hh:mm') - Timestamp#('08:30', 'hh:mm') , 'm')

To get this in script try like below

Data:

LOAD

*,

Interval(Timestamp#(Time2, 'hh:mm') - Timestamp#(Time1, 'hh:mm') , 'm') AS DiffInMinutes

FROM DataSource;

Hope this helps you.

Regards,

jagan.

aveeeeeee7en
Specialist III
Specialist III

Hi

Use Interval Function:

=Interval('08:40'-'08:30','mm')&'  ' &'minutes'

Result is as follows:

10 Minutes.png

Hope that helps you.

Regards

Av7eN

its_anandrjs
Champion III
Champion III

Hi,

Interval function is best for minute difference if the records in the same field then use Peek function to find that

LOAD

Time#( TimeField,'hh:mm' ) as TimeField, Interval(TimeField - Peek('TimeField'),'mm') as Diff,

LOAD * Inline

[

TimeField

08:30

08:40

];

If not then simple use

Time#(Time1,'hh:mm' ) as Time1,Time#(Time2,'hh:mm' ) as Time2,

Interval(Time2 - Time1,'mm') as Diff2;

Regards

Anand

MK_QSL
MVP
MVP

=Interval(Time#('08:40','hh:mm')-Time#('08:30','hh:mm'),'mm')

Not applicable
Author

Thanks all!

senpradip007
Specialist III
Specialist III

Welcome!!!!!!!!!!!!!!