Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Autogenerate + Select = Master Calendar with holidays

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

Tags (2)
1 Solution

Accepted Solutions
mov
Esteemed Contributor III

Autogenerate + Select = Master Calendar with holidays

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;

2 Replies
mov
Esteemed Contributor III

Autogenerate + Select = Master Calendar with holidays

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;

Not applicable

Autogenerate + Select = Master Calendar with holidays

Thank you, Michael. That's exactly what I was looking for.

Community Browser