Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
maxgro
MVP
MVP

10 Replies
markodonovan
Specialist
Specialist

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

Anonymous
Not applicable
Author

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.

Anonymous
Not applicable
Author

Hi All, Any help please

markodonovan
Specialist
Specialist

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

anbu1984
Master III
Master III

Anonymous
Not applicable
Author

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.Capture.PNG.png

Kushal_Chawda

give example where working days are not zero

Anonymous
Not applicable
Author

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

maxgro
MVP
MVP

see attachment