Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Networkdays

Good day,

I am trying to, as part of a Load process perform the NetworkDays function and I an receiving syntax issues.

At the end of my Load, I have added the following item:

NetWorkDays (Date1, Date2)  AS diff days

Also, what is the underlying calendar data that Qlik uses for holidays and weekends to correctly determine the days difference.

Thank you

Mitch

6 Replies
maxgro
MVP
MVP

Which error?

this is from Qlik help

networkdays (start:date, end_date {, holiday})

Returns the number of working days (Monday-Friday) between and including start_date and end_date taking into account any optionally listed holidays. All parameters should be valid dates or timestamps.

Are your field Date1 and Date2 date or timestamp?

Working days are Mon-Fry

Not applicable
Author

Error says that networkdays requires 2 parameters.

Do you know the format for the holiday?

Have an example?

Thanks

maxgro
MVP
MVP

The first 2 parameters are always needed and the format is date or timestamp.

example

=NetWorkDays(MakeDate(2015, 1, 1), MakeDate(2015, 1, 20))

my date format, beginning of the script, is SET DateFormat='DD/MM/YYYY';

=NetWorkDays('01/01/2015', '20/01/2015')

example with holidays

=NetWorkDays(today(), today()+2)                                                                 --> 3, no holidays

=NetWorkDays(today(), today()+2, today(), today()+1, today()+2)          --> 0, all 3 days holidays

Not applicable
Author

Thank you, I have the basic format working now.

I am confused about the holidays though. Not sure how to enter them in the format provided.


maxgro
MVP
MVP

you can use the date in your date format, mine is SET DateFormat='DD/MM/YYYY'

2 holidays

=NetWorkDays('01/01/2015', '20/01/2015',    '02/01/2015',  '15/01/2015')

here you can find a more complex example

Find Net Working Days

Not applicable
Author

Thank you very much