Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I'm trying to create a master calendar that will have a dim showing date type i.e. holi or working day. Calendar is an autogenerated set but holidays come from sql table (records present only holidays). Please take a look at the below example and suugest what to do to join them.
Input:
--------
LOAD
Date(Date#(20111231,'YYYYMMDD')+RecNo(),'YYYY-MM-DD') AS Date,
AUTOGENERATE Today() - MakeDate(2012, 1, 1) + 1;
SELECT Holiday FROM Holidays
Output:
----------
2012-01-01, holiday
2012-01-02, working day
...
Thanks,
Przemek
Przemek, see an example:
Input:
LOAD
Date(Date#(20111231,'YYYYMMDD')+RecNo(),'YYYY-MM-DD') AS Date,
AUTOGENERATE Today() - MakeDate(2012, 1, 1) + 1;
HolidayList:
SELECT Holiday FROM Holidays;
Output:
LOAD
Date,
if(exists(Holiday,Date), 'holiday', 'working day') as DateFlag
RESIDENT Input;
DROP TABLES Input, HolidayList;
Przemek, see an example:
Input:
LOAD
Date(Date#(20111231,'YYYYMMDD')+RecNo(),'YYYY-MM-DD') AS Date,
AUTOGENERATE Today() - MakeDate(2012, 1, 1) + 1;
HolidayList:
SELECT Holiday FROM Holidays;
Output:
LOAD
Date,
if(exists(Holiday,Date), 'holiday', 'working day') as DateFlag
RESIDENT Input;
DROP TABLES Input, HolidayList;
Thank you, Michael. That's exactly what I was looking for.