Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

ilanbaruch
Contributor II

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
New Contributor

Re: Timstamp Intervals


Use the below instead of interval 


(EndStamp-StartStamp)*1440

el_aprendiz111
Valued Contributor

Re: Timstamp Intervals

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') 

Community Browser