Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Time issue

Good day,

a company is open from 07:00 to 13:00 and trucks deliver goods only between these times

So there is a column Total Time spent, which is the total time a truck spent @ the company, even if it was closed.

The column Actual time spent must show the time that the truck spent @ the company between 07:00 and 13:00

Thus

Truck one, actual time spent should be 02:00 which is good,

Truck two, actual time spent should be 02:00 (09:00 minus 07:00 (open time))

Truck three, actual time should be 03:00 (10:00 minus 07:00 (open time))

Please see attached

6 Replies
Not applicable

Re: Time issue

Hi,

Please Find the attached file . Hope it will helps you

Re: Time issue

May be attached file might helps

Not applicable

Re: Time issue

Hi,

This is helpful, but what happens if the truck arrives at 12:30 PM, and departs at 13:30 PM,

Then the answer will be 13:30 - 07:00 = 6:30, but it should be 30 minutes.

Regards

Not applicable

Re: Time issue

Hi,

I like the expression, its a little complicated though.

The answer for the last one should be 03:00 though, is that possible?

Regards

MVP
MVP

Re: Re: Time issue

Hi,

PFA for solution.

Regards,

Jagan.

Not applicable

Re: Re: Time issue

Hi Jagan,

Please see attached under new discussion called time issue 1, I added some more data to the model you sent me, but its still incorrect. I also added a column with the correct answers.

Regards

Community Browser