Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
please let me know how to exclude Sat, Sun and holidays where i am having Id and Due Date.
Add buffer of 5 days in Due Date.
ID Due Date
C01 5th feb 2019
c02 12th feb 2019
Thanks in advance.
Networkdays() needs end date..and in the requirement we dont have the end date .
Where do you want to exclude saturdays, sundays and holidays from?
You probably need, LastWorkDate()/FirstWorkDate()
Hi Check the below code:
This may help with your requirement,
Temp:
Load ID+IterNo() as ID,
Date(Date+IterNo()) as Date,
WeekDay(Date+IterNo()) as WeekDay
While IterNo()<=10;
Load 1 as ID,
'01-06-19' as Date AutoGenerate 1;
Holiday_Calendar:
left join
LOAD * ,
1 AS IsHolidayFlag
INLINE [
Date, Description
05-06-19, Opt1
04-06-19, Opt2
];
Data:
Load ID,
Date,
WeekDay,
If(SubStringCount('$(vWeeklyHolidays)', WeekDay(Date)) OR IsHolidayFlag = 1, 1, 0) AS IsHolidayFlag,
If(SubStringCount('$(vWeeklyHolidays)', WeekDay(Date)) OR IsHolidayFlag = 1,'Non Working/Holiday', 'Working Day') AS DayType
Resident Temp;
DROP Table Temp;
With some sample data , created some flags for holidays.
PFA APP for ref. let us know if missing anything.