Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to add 3 working hours in a expression

Hi All,

we have a nr of working hours to complete a task,

Our working hours is from Monday to Friday 8am to 5pm, If I get a task at 4pm in the afternoon and the turnaround time for this specific task is within 3 working hours then I would like to add an expression to show that the new tasks must be completed by 10am the following morning.

This will then help us to prioritise the task that is closed to their specific deadline,

I know you can use the below in to an expression and it works but it does not take working hours in to consideration

+time#(3,'hh')

Any ideas how to add this expression

Kind regards,

Sharette

11 Replies
Not applicable
Author

§ Dear Agis,

I wonder if you can help me with the following on this same expression

I am now trying to add 11 working hours and it is not calculating correct and I am also trying to exclude the weekends with the if weekday = 5 then add more hours

Example 1 : adding 11 working hours

I am still using the same expression, please see below

Date = 01-Sept-14 17:00 pm

=if(hour(time() + 0.4583) < 17,

timestamp(num( + 0.4583)),

timestamp(num( + 1.0833)))))

Date expression gives me is 02-Sept-14 03:59 am

Correct answer should be 03-Sept-14 11:00 am

Example 2: exclude weekends

Date = 29-Aug-14 17:00 pm

=if(weekday(if(hour(time() + 0.4583) < 17,

timestamp(num( + 0.4583)),

timestamp(num( + 1.0833)))) = 5,

timestamp(num( + 3.0833)))

Date expression gives me is 01-Sep-14 18:59 pm

Correct answer should be 02-Sep-14 11:00 am

Please can you have a look and advise what I need to do,

Thank you

Kind regards,

Sharette

Agis-Kalogiannis
Employee
Employee

Hi Sharette... Could you please try the following?

CASE A:

=if(

     hour(time([SQRRfCD])+3)<17,

          timestamp(num([SQRRfCD]+1.125)),

          timestamp(num([SQRRfCD]+1.75))

     )

Now, could you please apply the new changes to you weekend expression and check if you are getting correct results?

Regards

Agis