Calculate Workdays

Calculates the number of whole workdays between two dates. The calculated number of days is inclusive of the start and end dates. Specified weekend days and holidays are not included in the total.

If the source for PublicHolidays is set to 'Field', this field must be presented to the node on a separate input pin.

The property DateFormatString can be used to set the string format that dates are parsed from. When setting a format, the following pattern letters can be used (all other characters from 'A' to 'Z' and from 'a' to 'z' are reserved):

	G	Era Designator (For example, "AD")	
	y	Year (For example, 1996;96)	
	M	Month in year (e.g. "July";"Jul";07)	
	w	Week in year (e.g. 27)	
	W	Week in month (e.g. 2)	
	D	Day in year (e.g. 189)	
	d	Day in month (e.g. 10)	
	F	Day of week in month (e.g. 2)	
	E	Day in week (e.g. "Tuesday";"Tue")	
	a	AM/PM marker (e.g. "AM")	
	H	Hour in day (0-23 e.g. 0)	
	k	Hour in day (1-24 e.g. 24)	
	K	Hour in AM/PM (0-11 e.g. 0)	
	h	Hour in AM/PM (1.12 e.g. 12)	
	m	Minute in hour (e.g. 30)	
	s	Second in minute (e.g. 55)	
	S	Millisecond (e.g. 978)	
	z	General Time Zone (e.g. "Pacific Standard Time"; "PST"; "GMT-08:00")	
	Z	RFC 822 Time Zone (e.g. "-0800")

Pattern letters are usually repeated, as their number determines the exact presentation. For example, the format string 'yyyy' will parse a string such as '2012' as the year 2012, whereas the format 'yy' will parse a string '12' as the year 2012.

Other examples of date formats:

	"yyyy.MM.dd G 'at' HH:mm:ss z"		2001.07.04 AD at 12:08:56 PDT
	"EEE, MMM d, ''yy"			Wed, Jul 4, '01
	"yyyyy.MMMMM.dd GGG hh:mm aaa"		02001.July.04 AD 12:08 PM
	"EEE, d MMM yyyy HH:mm:ss Z"		Wed, 4 Jul 2001 12:08:56 -0700
	"yyMMddHHmmssZ"				010704120856-0700
	"yyyy-MM-dd'T'HH:mm:ss.SSSZ"		2001-07-04T12:08:56.235-0700

Properties

StartDate

Specify the start date of the time period. By default the date format is "yyyy-MM-dd" - to change this see the DateFormatString property.

Choose the (from Field) variant of this property to look up the value from an input field with the name specified.

A value is required for this property.

EndDate

Specify the end date of the time period. By default the date format is "yyyy-MM-dd" - to change this see the DateFormatString property.

Choose the (from Field) variant of this property to look up the value from an input field with the name specified.

A value is required for this property.

WeekendCode

Optionally specify the number of days and which days of the week are considered to be weekend days.

If not specified, Saturdays and Sundays are considered to be weekend days. If specified, the WeekendCodeFormat property must also be specified.

Choose the (from Field) variant of this property to look up the value from an input field with the name specified.

WeekendCodeFormat

Specify the format of the Weekend Code specified in the WeekendCode property. Choose from:

  • Weekend Number Code - Corresponds to the numeric weekend code indicator as used within the Excel Networkday.Intl function. An Integer value in the range 1 to 7 or 11 to 17.
  • Weekend Bitmap Code - Corresponds to the bitmap representation of the weekend days as used within the Excel Networkday.Intl function. A string of seven characters. Each character may be a '0' or '1'. A '0' indicates a work day and a '1' indicates a weekend day. The first character represents Monday and the last Sunday, e.g. the string "0000011" indicates Saturday and Sunday are weekend days.
  • Day of Week Code - Corresponds to Data360 Analyze Day of the Week values. One or more semicolon-separated integers where each integer represents a day of the week. The week begins on Sunday, whose week day code is zero.

A value must be set if the WeekendCode property is populated.

Choose the (from Field) variant of this property to look up the value from an input field with the name specified.

PublicHolidays

Optionally specify one or more additional dates that are to be excluded from the total number of working days.

Multiple dates can be separated by comma or semicolon. The date format is "yyyy-MM-dd" - to change this see the DateFormatString property.

By default no dates will be excluded from the result.

Choose the (from Field) variant of this property to look up the value from an input field with the name specified. This field must be presented to the node on a separate input pin.

PrivateHolidays

Optionally specify one or more additional dates that are to be excluded from the total number of working days.

Multiple dates can be separated by comma or semicolon. The date format is "yyyy-MM-dd" - to change this see the DateFormatString property.

By default no dates will be excluded from the result.

Choose the (from Field) variant of this property to look up the value from an input field with the name specified.

OutputFieldName

Optionally specify the name of the output field that contains counted working days.

The default value is "_WorkdaysCount".

PassThroughFields

Optionally specify which input fields on the first input will "pass through" the node unchanged from the input to the output, assuming that the input exists. The input fields specified will appear on those output records which were produced as a result of the input fields. Choose from:

  • All - Passes through all the input data fields to the output.
  • None - Passes none of the input data fields to the output; as such, only the fields created by the node appear on the output.
  • Used - Passes through all the fields that the node used to create the output. Used fields include any input field referenced by a property, be it explicitly (i.e., via a 'field1' reference) or via a field pattern (i.e., '1:foo*').
  • Unused - Passes through all the fields that the node did not use to create the output.

The default value is Used.

If a naming conflict exists between a pass-through field and an explicitly named output field, an error will occur.

DateFormatString

Optionally specify the date format to be used for parsing dates provided as a literal or textual field. The characters to be used in writing the format string are described in the node help.

The default date format string is "yyyy-MM-dd".

Inputs and outputs

Inputs: 2 optional.

Outputs: out1.