Set a target completion date based on work days not calendar days


Hi,

 

I have a workflow with multiple steps. The goal is to calculate target completion date for each step. I am trying to do this by using the Add days function with process start date and looks up a table in smartobject for that specific process time required (in work days). The only problem is that the current result assumes that the days required are calendar days when they are actually work days (Saturday and Sunday off) (e.g. 31-Jan + 2 = 2 Feb and it should be 31-Jan + 2 = 5 Feb).

How can I modify to make sure I am adding work days to the process start date?

Thanks


11 replies

Userlevel 5
Badge +13

In the K2 Management site (or K2 Workspace if you are on 4.7 or lower) there is a section for "Working Hours" where you can define what the system should consider a business day. Start with this and see if it can help solve your issue.

Hi,

 

I have done that but it doesnt seem to work.

My understanding is that the working hours will impact escalations and deadlines.

Thanks,

MAref

Userlevel 5
Badge +13

You're right, my apologies... looking closer at how I used that information in the working hours, I see I built a web service that consumes it and does the calculation for me. That is probably more work than you were looking for, but is that an option for you?

Is it possible for me to do an if statement in the workflow so that after adding the calendar days, it checks what day if the week it is, if its a saturday then it adds 2 days, sunday it adds 1 day and for everything else it returns the orginal date?

Userlevel 5
Badge +13

One other option may be to use the client event's "Deadline" property. This has the built-in ability to use the working days, but I'm not sure where you are trying to consume this date and if having it on the task itself will be ok. I'm trying to find a solution that doesn't involve coding it yourself...

I am trying to save the calculated Target completion date in a smartobject so that I can pull it and use as part of a visual dashboard. I wouldnt want the task to expire if it is past due, in my case It would be flagged on the visual dashboard as being late.

Userlevel 5
Badge +13

I see - then yes, I'm afraid you'll have to work some magic with the expression buidling in a data transfer event to make this happen as you'd like it to. I think it would be worth adding a feature request to include functions for "Add Working Days" instead of just "Add Days" to take advantage of the zones you can set up in the workspace/management site.

Thanks, could you advise in how to get the weekday function in smart form?

Userlevel 5
Badge +13

You would need to create an expression, and within that expression you can use the weekday function.

Badge +3

I have a Service broker that will calculate business days in a given date range.  I think we also have add days function in it as well.  Hence you pass in a start date and the days you wish to add and it eliminates holidays and weekends.  We also have a version that you can pass in as a third paramenter a list of dates that are your own custom holidays.  Send me an email if you are interested and have not found a solution. (*personal details removed*)

Badge +3

If you need, we have a business day calculator service broker. www.method-automation.com.  Given a start date and end date it will calculate your business days.  We also have another broker that calculates SLA's based off of the workfing hours set up in your K2 envrionement which includes you exception days (works for K2 Five and K2 Cloud and 4.7)   You can direct message me or send and email - happy to help (*personal details removed*)

Reply