Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date Time Interval Mathematics

Hi,

I have 4 columns like the following...

Date1 Time1 Date2 Time2
18.01.2011 0100 19.01.2010 0200

and i wanted to create an EXPRESSION to calculate total hrs.

Can someone contribute the formula? [;)]

Thanks.

1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

hei

attach is an example of what you asked

hope its helps you

View solution in original post

4 Replies
deepakk
Partner - Specialist III
Partner - Specialist III

Hi,

Modify the time1 and time2 field to

time(left(time1,2) & ':' & right(time1,2),'hh:mm') as time1

time(left(time2,2) & ':' & right(time2,2),'hh:mm') as time2

Now time(Sum(time1),'hh:mm') will give you total no of time for time1 field and

time(Sum(time2),'hh:mm') will give you total no of time for time2 field.

Not applicable
Author

Hi Deepak,

Thanks for your suggestion.

But if i do that, i'll only have the difference of one hr.

In fact, the answer should be 25 hrs because of the date. In the expression, we need to take into consideration of the date if it's not on the same date. That's the tricky part, to me...

lironbaram
Partner - Master III
Partner - Master III

hei

attach is an example of what you asked

hope its helps you

Not applicable
Author

Hi Nick,

here are a second one.

Good luck!

Rainer