10 Replies Latest reply: Oct 28, 2014 3:52 PM by Vinay Bangari

# 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.

• ###### 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

• ###### 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.

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

Hi All, Any help please

• ###### 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

• ###### 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.

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

give example where working days are not zero

• ###### 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

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

see attachment

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

Hey Massimo, Thanks a lot for your help. You are my guru . Need to learn some of the scripting from you man..I tried in a different manner. attached is my qvw file.