addWorkingDays function in the Factory

The addWorkingDays function adds a given number of working days (excluding weekends) to a date attribute.


addWorkingDays(date, nday)




The date attribute we want to add working days to. The date parameter is mandatory.


The number of working days to add to the chosen date attribute. The nday parameter is mandatory.

Date type valid formats (if the values aren’t this format, the function will return an error).

  • 2019/10/12;

  • 12/10/2019;

  • 2019-10-12;

  • 12-10-2019;

  • 2019/Oct/12;

  • 12/Oct/2019;

  • 2019-Oct-12;

  • 12-Oct-2019.


The following example uses the Bike sales dataset.



In this example, we want to add five working days to the Date attribute.

We type the following formula in the addwd attribute:


and the attribute will be filled with the Date attribute’s values postponed by five working days, which might be more than five days, as weekends are excluded by the function and it considers only working days, not calendar days.

The results are as follows:

  • In row 1, the Date value 2013-11-26 becomes 2013-12-03: the 26th of November was Tuesday, and the 3rd of December was Monday. Five working days have been added

and so on.