I need to calculate the working days between two dates excluding only Sunday and holidays. The problem is that the function NetWorkDays in qlikview always consider Saturday as non working days.
I need to do the same to calculate the last work date including Saturday but excluding Sunday and holidays.
I've to use it in an expression, I've just tried the following expression but it does not consider if there is a saturday which is holiday:
I wasn't able to find a solution for LastWorkDate function including Saturday.
I've already read this link Master Calendar with Working days & Holidays Flag but I don't know how can I use it in my case.
Thank you very much for any suggestions.
look at my attached example, it is an example, where you can calculate the networking day with excluding of Sunday and Holiday
i hope that helps
Thanks for yout feedback in you example you are using NetWorkDays function that excludes Saturday and Sunday, am I wrong?
I need to do this calculation in front end and not in load script.
I have gone through your example. Its calculating the working days excluding Saturday,Sunday, and public holidays.
Could you please explain how I can calculate working days by excluding Sundays and Holidays only.
Date(Date#(MyDate, 'DD.MM.YYYY')) as MyDate
Concat(Chr(39) & MyDate & Chr(39), ',') as HolidayDays
Let vPublHoliday = FieldValue('HolidayDays',1);
Let vCurrentMonth = Month(Today());
Date(Date#(SalesDate, 'DD.MM.YYYY')) as SalesDate, Sales
Month(SalesDate) as MyMonth,
MonthName(SalesDate) as MyMonthYear,
if(Year(SalesDate) = Year(Today()) and Month(SalesDate) = Month(Today()),
$(vPublHoliday))) as MyWorkingDays
drop Table MySales, Holiday;
if you create on UI the straight table, you can see 03.06.2017, and this Day is Saturday.
I hope that helps, if you have any question, let me please know,
Thanks for your feedback, I have used a different script to solve the issue. Could you please review it once.
If(WeekDay(Date(DateNumber)) <> 6 and not match(Date(DateNumber),$(vPublicHolidays)),'Working','Not Working') as WorkingDayFlag