Skip to main content
Announcements
Qlik Announces Qlik Talend Cloud and Qlik Answers: LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
narband2778
Creator II
Creator II

Time Difference in hh:mm using Interval function between two DateTimes

Hello Qliks,

I am trying to find time difference in hh:mm from MinDateTime to MaxDasteTime

Ex: Interval('07/02/2018 13:14:00' - '07/02/2018 14:30:00', 'hh:mm')

I am looking for an output: -00:46

but, I am getting below result: -73894114:46

How can I resolve this.


Thanks in Advance.

Naresh

2 Replies
sunny_talwar

How are you getting -00:46? why not 1 hour and 16 minutes here?

This gives me 1:16

=Interval(MakeDate(2018, 7, 2) + MakeTime(14, 30) - MakeDate(2018, 7, 2) - MakeTime(13, 14), 'hh:mm')

YoussefBelloum
Champion
Champion

Hi,

the above gives you 01:16

this : =Interval('07/02/2018 13:14:00' - '07/02/2018 14:30:00', 'hh:mm') will give you -00:46


also, you should evalute and format your timestamp fields as Timestamps using Timestamp#() and Timestamp()