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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
tamilarasu
Champion
Champion

Working Day Count in a year

Hi

I am creating a calendar and need your suggestions on how to do the below. I just want to create a total working day in a year with few criteria.

* First day of the year should be 1. If it is holiday (WO column indicated as 0 (Sat, sun and holiday)) then next day should also 1. Likewise the count should go till year end. But if a month end (31-01-2012) is holiday or sun day, then the next day should incremented automatically.

* Again Next year should start with 1.

Please see screenshot for better understanding.  I need to do exactly like below mentioned as "Need to do in QV"

Capture1.PNG

Thank you in advance.

Labels (1)
6 Replies
tamilarasu
Champion
Champion
Author

Any idea?

maleksafa
Specialist
Specialist

you can use the networkdays function that calculates the number of working days between two dates and it can take optionally the holiday dates, you need to use this function while building your calendar script and loop over the networkdays to build the calendar.

Not applicable

Hi,

try using

NetWorkDays(year_start_date,Year_end_date) which returns all the working days excluding weekends

could you just be little more precise with what your requirement is , like is the above mentioned table format is what you want in QlikView.

let me know...

saumyashah90
Specialist
Specialist

1)

=NetworkDays(Start_Date,End_Date)

this will count no of working days.excluding satudays and sundays.

2)This wont count public holidays or local holidays which you might have to add it externally into expression

tamilarasu
Champion
Champion
Author

I need to create a column exactly what I have shown in the picture (Column name working days). I want to know, if a day is holiday then the  working day count should same as previous day. For example, working day count of the date 04-01-2014 is 5, if suppose 05-01-2014 is holiday then the count of the next day is also 5 and 06-01-2014 is 6 like wise. Same rule for Saturdays and Sundays.I have a 3 years data, so bit confused on how to do this.

Capture.PNG

Not applicable

1. NetWorkDays(FKDAT,FKDAT) returns 0 if its a weekend and returns 1 if its a week day

2. loop this as

if(NetWorkDays(FKDAT,FKDAT) ,use rangesum(workingDays,peek('workingDays')) as WorkingDays function.

try doing this may b it should work

let me know