# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Rules, plus terms and conditions, can be found here.
Valued Contributor III

## Calculate Number of working days between Sundays

Hi All i have a requirement that i need to calculate the working days between two any given sundays. Attached is the QVW file which will have  _FlagWorkingDay column if  _FlagWorkingDay=0 then its not a working day and if  _FlagWorkingDay=1 then it is a working day. Now i want the output like this in my final table should look like i need dates related to sundays and working days related to that sunday. Please let me know in case of any questions. i am attaching the QVW file.

1 Solution

Accepted Solutions
MVP

## Re: Calculate Number of working days between Sundays

see attachment

10 Replies
Valued Contributor

## Re: Calculate Number of working days between Sundays

Hi Vinay,

Have a look at the NetworkDays function

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.

Examples:

networkdays ('2007-02-19', '2007-03-01') returns 9

networkdays ('2006-12-18', '2006-12-31', '2006-12-25', '2006-12-26') returns 8

Thanks

Mark

www.techstuffybooks.com

Valued Contributor III

## Re: Calculate Number of working days between Sundays

HI Mark, Thank you for your response. Actually i want that calculation need to perform in the script. Here is the challenge i don't have date range i can mention because i will always have 2 to 3 years of data. Another challenge is My working days does not depend on weekdays ( Monday- Friday). Its based on our warehouse working days and that working days will be determined by _FlagWorkingDay. Thanks for your help in advance.

Valued Contributor III

## Re: Calculate Number of working days between Sundays

Valued Contributor

## Re: Calculate Number of working days between Sundays

Hi Vinay,

Do you mean you need to have the number of working days (_FlagWorkingDay) calculated for a selected date range ?

If not can you give an example of what you would like to see.

Thanks

Mark

Honored Contributor III

## Re: Calculate Number of working days between Sundays

Valued Contributor III

## Re: Re: Calculate Number of working days between Sundays

Hi Anbu & Mark, Sorry if i confuse you guys more. Please see attached screen shot which explains my problem. Please let me know if you need more information.

MVP

## Re: Calculate Number of working days between Sundays

give example where working days are not zero

Valued Contributor III

## Re: Re: Calculate Number of working days between Sundays

Hi Kush, I have attached QVW file in my first post. In case if you missed that please find with the attached

MVP

see attachment