Skip to main content Skip to complementary content

networkdays - script and chart function

The networkdays function returns the number of working days (Monday-Friday) between and including start_date and end_date taking into account any optionally listed holiday.

Syntax:  

networkdays (start_date, end_date [, holiday])

Return data type: integer

Calendar diagram displaying date range returned by networkdays function

ADD ALT TEXT HERE.....!!!!!!

The networkdays function has the following limitations:

  • There is no method to modify workdays. In other words, there is no way to modify the function for regions or situations that involve anything other than working Monday to Friday.

  • The holiday parameter must be a string constant. Expressions are not accepted.

Arguments
Argument Description
start_date The start date to evaluate.
end_date The end date to evaluate.
holiday

Holiday periods to exclude from working days. A holiday is stated as a string constant date. You can specify multiple holiday dates, separated by commas.

Example: '12/25/2013', '12/26/2013', '12/31/2013', '01/01/2014'

When to use it

The networkdays() function is commonly used as part of an expression when the user would like the calculation to use the number of working week days that occur between two dates. For example, if a user would like to calculate the total wages that will be earned by an employee on a PAYE (pay-as-you-earn) contract.

Function examples
Example Result
networkdays ('12/19/2013', '01/07/2014') Returns 14. This example does not take holidays into account.
networkdays ('12/19/2013', '01/07/2014', '12/25/2013', '12/26/2013') Returns 12. This example takes the holiday 12/25/2013 to 12/26/2013 into account.
networkdays ('12/19/2013', '01/07/2014', '12/25/2013', '12/26/2013', '12/31/2013', '01/01/2014') Returns 10. This example takes two holiday periods into account.

Regional settings

Unless otherwise specified, the examples in this topic use the following date format: MM/DD/YYYY. The date format is specified in the SET DateFormat statement in your data load script. The default date formatting may be different in your system, due to your regional settings and other factors. You can change the formats in the examples below to suit your requirements. Or you can change the formats in your load script to match these examples.

Default regional settings in apps are based on the regional system settings of the computer or server where Qlik Sense is installed. If the Qlik Sense server you are accessing is set to Sweden, the Data load editor will use Swedish regional settings for dates, time, and currency. These regional format settings are not related to the language displayed in the Qlik Sense user interface. Qlik Sense will be displayed in the same language as the browser you are using.

Example 1 – Basic example

Example 2 – Single holiday

Example 3 – Multiple holidays

Example 4 – Single holiday

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!