Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

time interval calculation

I have a start time and end time. How do I get the duration or the interval between the start and end time.

suppose for an example,

starttime; 10.20 am

endtime:     2.20 pm

my desire result: 4.00.00

4 Replies
Nicole-Smith

This returns what you want:

=interval(time#('2.20 pm', 'h.mm TT')-time#('10.20 am', 'hh.mm TT'),'h.mm.ss')

So with field names:

=interval(time#(endtime, 'h.mm TT')-time#(starttime, 'hh.mm TT'),'h.mm.ss')

its_anandrjs

Hi,

Write some thing like

Interval( endtime - starttime , 'hh:mm TT' )


Hope this helps

Thanks & Regards

Anonymous
Not applicable
Author

LOAD

     id_number,

     timestamp_from,

     timestamp_to,

     Interval(timestamp_from - Previous(timestamp_to) , 'hh:mm:ss') as Duration_time

FROM TableName

its_anandrjs

Hi,

Interval match only works in load script sop write a code like

Interval( endtime - starttime , 'hh:mm TT' ) as Time_Diff

Hope this helps

Thanks & Regards