Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all
I have a question on how to calculate the number of working day taken by employee.
Many company has block leave policy - to take 5 working days continuously.
It can be in any combination. e.g. (Mon, Tue, Wed, Thu, Fri ) , (Thu, Fri, Mon, Tue, Wed) , or (Wed, Thu(public holiday), Fri, Mon, Tue, Wed).
I have a set of data with the following format
staff ID Leave Date
001 8/10/2015
001 8/11/2015
001 8/12/2015
001 8/13/2015
001 8/14/2015
001 8/25/2015
001 8/31/2015
001 9/1/2015
002 8/14/2015
002 8/15/2015
002 8/18/2015
002 8/25/2015
002 8/26/2015
002 8/27/2015
002 9/7/2015
003 8/14/2015
003 8/17/2015
003 8/18/2015
003 8/19/2015
003 8/20/2015
003 8/25/2015
003 8/31/2015
003 9/1/2015
I want to know have an Block leave taken indicator - Y means the staff took block leave, N means not.
in the case above 001 and 003 have block leave indicator - Y while 002 has N
Any assistance is appreciated.
Thanks!
Calculate the number of working days using
NetWorkDays(start_date, end_date)
If you want to account for public holidays, you will need to load the dates into a comma separated list of dates (either in numeric format, or as quoted date format). Like this:
NetWorkDays(start_date, end_date, '2015/06/16', '2015/09/24', ...<more dates>....)
You can construct the holiday list in script into a variable, then use the variable like:
NetWorkDays(start_date, end_date, $(vHolidays))
Appreciated your response.
I am aware the usage of NewWorkDays.
However, the challenge of this question is it's difficult to pick the start date and end date.