Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
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
Partner

hei

attach is an example of what you asked

hope its helps you

View solution in original post

4 Replies
deepakk
Partner
Partner

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
Partner

hei

attach is an example of what you asked

hope its helps you

View solution in original post

Not applicable
Author

Hi Nick,

here are a second one.

Good luck!

Rainer