Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
How to calculate the number of working days for a month.I understand we can use the network days. But i have an issue like if there are two employees A and B. A will be full time and B will be part time he will be working 3 days a week. So how to calculate the working days for the employee B in Qlikview.
It is impossible to give an exact answer because the rules for the working dyas are not specified. So, I go with the next three assumptions:
1. You have a "calendar" table which contains at least Month and Date fields.
2. Employee B works on Monday, Tuesday, and Wednesday.
3. There are no holidays for B.
In this case, you can use this:
WorkDaysB:
LOAD
Month,
count(distinct if(weekday(Date)<3,Date)) as WorkDaysB
RESIDENT Calendar
GROUP BY Month;
Regards,
Michael
Thanks Michael,
How about Working days * (3/5).
It all depends on the specific rules, which are still unknown. It works as approxiamtion, but not as the exact count. For example, using the same assumption (Monday to Wednesday), in February 2012, we have 21 workdays for A, and 12 for B. If use 3/5 rule, you get 12.6 for B - or 13 if round to integer. If this precision is enough in your case, feel free to use it.