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: 
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

Labels (1)
4 Replies
Nicole-Smith
MVP
MVP

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
Champion III
Champion III

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
Champion III
Champion III

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