Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Save $600 on Qlik Connect registration! Sign up by Dec. 6 to get an extra $100 off with code CYBERSAVE: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
ilanbaruch
Specialist
Specialist

Timstamp Intervals

hi all,

trying to calculate duration in minutes between 2 Timstamps

create Timstamp in script as below:

Timestamp(StartDate&' '&StartTime,'YYYYMMDD hh:mm') as StartStamp,

Timestamp(EndDate&' '&EndTime,'YYYYMMDD hh:mm') as EndStamp,

calculating interval in both script and layout as below

Interval(EndStamp-StartStamp,'hh:mm')

and looks ok but,

when there is a day deference result comes bad... i.e :

end stamp = 20171105 00:01

start stamp = 20171104 23:56

endstamp - startstamp retrieves   :  -23:54 from script calculation

or

216:06 in layout calculation

where the result is 00:06.....

would appreciate your help,

advanced thanks

2 Replies
rbailey007
Contributor
Contributor


Use the below instead of interval 


(EndStamp-StartStamp)*1440

el_aprendiz111
Specialist
Specialist

Hi,

=Interval(
Time( Frac( Timestamp#( '20171104 23:56', 'YYYYMMDD hh:mm')), 'hh:mm')
-
Time( Frac( Timestamp#( '20171105 00:01', 'YYYYMMDD hh:mm')), 'hh:mm')
,'hh mm')