Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

NetWorkDays: Excluding Friday and Saturday between two dates

Hi all,

I am trying to calculate count of days between any two given dates including boundary dates.

This count should exclude all Fridays and Saturdays ( as Fri and Sat are weekend in Middle East).

NetWorkDays() give count which excludes Sat and Sun by default.

Please suggest how can I customize or create expression to achieve the same excluding Fridays and Saturdays?

Tags (2)
1 Solution

Accepted Solutions
Not applicable

Re: NetWorkDays: Excluding Friday and Saturday between two dates

Finally it worked this way without Setting DayNames variable.

=Networkdays(DateA+1, DateB+1)

Found answer here Re: Get num of days between 2 dates

5 Replies
MVP
MVP

Re: NetWorkDays: Excluding Friday and Saturday between two dates

You could change the default week start and try thereafter with networkdays. Please refer: Ancient Gods and Modern Days for changing the week start.

senpradip007
Valued Contributor III

Re: NetWorkDays: Excluding Friday and Saturday between two dates

Have a look at the attachment.

sujeetsingh
Honored Contributor III

Re: NetWorkDays: Excluding Friday and Saturday between two dates

Tresco a best way.

Not applicable

Re: NetWorkDays: Excluding Friday and Saturday between two dates

tresesco‌ and senpradip007‌ thanks for replying.

I Changed the order of day names and tried again.

SET DayNames='Sun;Mon;Tue;Wed;Thu;Fri;Sat';

I don't think the below is excluding Fridays and Saturdays.

For month of August I am getting below result.

NetWorkDays( MonthStart(date(Today())), MonthEnd(Date(Today()))) = 21

If it excludes Fri and Sat as expected, I should get 22 as result.

Please suggest.

Not applicable

Re: NetWorkDays: Excluding Friday and Saturday between two dates

Finally it worked this way without Setting DayNames variable.

=Networkdays(DateA+1, DateB+1)

Found answer here Re: Get num of days between 2 dates