I recently discovered this ingenious open source scripting components for Qlikview. It allows for easier scripting of Master calendars with much more capabilities.
I was posed with a problem at working for allowing our end users to easily create master calendars for the own Dashboards but they need to have the ability to use our Fiscal calendar instead of a standard calendar. I extended the Qlikview component scripts by creating my own calendar function that easily replicates our fiscal calendar business rules.
So now all the end users need to do is to include my dupre.qvs file and then use the call Dupre.FiscalCalendar.
Here is an example of call being used:
//Get the Min and Max of the Accident Date
min([Accident Date]) as minDate,
max([Accident Date]) as maxDate
//Assigning the Variables
lET vDateMin = num(Peek('minDate',0,'Temp'));
LET vDateMax = num(Peek('maxDate',0,'Temp'));
//Drop the Temp table as it is no longer used
DROP Table Temp;
//Indicate that we do want the set analysis variables created
SET Qvc.Calendar.v.CreateSetVariables = -1;
//Set the Field that we want qlikview to auto-join to
SET _Qvc.Calendar.v.Field.Date.Override = 'Accident Date';
//Create the FiscalCalendar with the Min and Max Date, name the table "FiscalCal" and prefix all the columns with "FS"
Here is the QVS:
An error has occurred. Please try again later.
For those wanting additional information on the qlikview components, check out their Google Project page: qlikview-components – A script library for Qlikview development – Google Project Hosting.