Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Summing time

Hi,

Can someone help me with the below please?

I have three fields within my data - Vehicle - start time and end time.

the start and end time are in time stamp - e.g. 23:52:25.

What i want to do is sum how many hours a vehicle has been driven.

example data -

Vehicle Start TimeEnd Time
Vehicle 100:02:3823:25:25
Vehicle 201:04:0020:00:00
Vehicle 306:00:0012:00:05

I'm using QlikSense.

Thanks in advance !

2 Replies
Highlighted
Champion
Champion

Hi,

you can use Interval() function

https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/FormattingFunc...

make sure to evaluate and format your timestamps correctly

it should be something like this:

Interval([End Time]-[Star Time],'hh')


or if your fields are not yet correctly evaluated and formatted on the script:


Interval(Timestamp#([End Time],'hh:mm:ss')-Timestamp#([Star Time],'hh:mm:ss'),'hh')

Highlighted
MVP & Luminary
MVP & Luminary

Hi,

Try Interval function to get the time difference.

Like

Load * ,Interval (EndTime-StartTime) as DriveTime

From xyz;

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".