Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good day,
The question I asked earlier on was not so clear. Now I am simplifying it, I have a date field called LeaveDate and it contains Working days from Monday to Friday, Weekends and Holiday. So in my country if a holiday falls on a Sunday, then following day(i.e Monday) will be counted as a holiday. So in my attached spreadsheet, I have highlited the holidays and weekends in Yellow. So what I would like to exclude weekends and public holidays.
hope my question is clear.
Thanks
LET vDatMi = Num(MakeDate(2015,1,1));
LET vDatMa = Num(MakeDate(2017,1,1));
CAL1:
LOAD
Date($(vDatMi) + IterNo()) AS ALL_DATE
AUTOGENERATE 1
WHILE $(vDatMi)+IterNo() <= $(vDatMa);
HOLIDAY_WEEKEND:
LOAD
if(match(weekday(ALL_DATE),'Sat','Sun'),ALL_DATE) as Holidays
Resident CAL1;
Drop Table CAL1;
Concatenate
PUBLIC_HOLIDAY_LIST:
LOAD Holiday as Holidays
FROM
[Public Holidays.xlsx]
(ooxml, embedded labels, table is Sheet1);
LEAVE:
LOAD LeaveDate as Working_day
FROM
[Leave Data.xlsx]
(ooxml, embedded labels, table is Sheet1) where not Exists(Holidays,LeaveDate);
Exclude them how? Exclude them from loading? Also, do you have this second column which specify the word 'Holiday' or is that something you have to derive from another place?
Hi Sunny,
May be have an indicator created to identify it's a holiday/weekend then I will use the indicator in my expression to exclude them in my calculation.
Weekend indicator is easy, how do we know if a certain date is a holiday? I mean 12/16/2016 is a holiday in your country, where do you get that information from?
I actually have Public holiday spreadsheet which has holidays.
PFA
you can generate a consolidate holiday list then by using where not exist you can remove the holidays
I don't see the attachment, can you may be reattach?
Since 25th Dec was a Sunday, you get extra holiday on 27th? because 26th was a Holiday also?
here holiday has been generated form 1/1/2015 to 1/1/2017 and your public holiday is added to that