Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Counting working days

Hi,

I would need to count the amount of working days between certain date range. The issue is that I have a Table A in which there are FromDate and ToDate -fields to determine the date range. Then I have a Table B in which there is a TransDate -field that contains the information about each date whether it is a working day or not. How can I define in the script that I should get a count of working days (Count(TransDate)) between FromDate and ToDate? In addition, in the Table A, there is a AmountMST -field which value I need to divide by the amount of working days. The issue is presented and explained below in more detail:

Table A:
FromDate
ToDate
AmountMST (this needs to be divided by the amount of working days)
EmplID

Table C:
EmplID
CalendarID

Table B:
CalendarID
TransDate (we need to count all the days that are working days between
any given FromDate and ToDate values)
WorkTimeControl (the value of this field needs to be 0 in order to
get rid of free days. That way only working days are
left and we can get their count)

The issue in more detail is the following:
We have forecasted a certain labor cost (AmountMST) for each employee for a certain date range (FromDate - ToDate). We want to be able to determine a labor cost per day. For that we need to determine the amount
of working days in that date range. We can figure it out by first identifying employee's calendar through Table C. Then in table B, get all the working days for that employee as we set WorkTimeControl to 0. However, I find it difficult to define that we need to have a count of working days from a certain date range. Can anybody help with that?

Thanks,

Petteri

2 Replies
amars
Specialist
Specialist

Hi,

I don't really understand your problem but try to use the networkdays formula.

Regard's

Amar

Not applicable
Author

Use the networkdays() function. Refer to help manual for details.

Regards,

Amit