The main building block of the QlikView deployment framework (qdf) is the resource container. Every environment using QDF will be build using only one to many instances of this homogeneous structured entity.
When first introduced to the QDF the first thing you’ll notice is the container folder and it’s 9 folders structure. I’ll explain which they are and what their purpose in the section below.
The 9 folders
The folder names in a QDF container give you a good indication on what they contain. They are sense quite self-explanatory and after reading the section below you’ll be ready to start working with them.
You will place all your QlikView (.qvw) or Qlik Sense (.qvf) applications in the root or in sub folders of
1. Application. Only these two file types you should be kept in this folder. Prj-folders and version control files are exceptions that will reside inside
The path for QlikView data files. This folder will work as the source path where your application reads qvd files and/or the folder where you store qvds into.
The folder where all .qvs files that is to be included into your QlikView or Qlik Sense script resides. This could be qvs files you create yourself or the pre-made scripts that are bundled with the framework.
The key to QDF initiation is found in a sub folders of
3.Include It is called
init.qvs and is absolutely necessary to start using and take advantage of the QDF framework. I recommend all developers to click through these folders to get an impression of all shipped features that comes with the QDF.
Variable files and connections strings are typically placed in another sub folder to
3.Include. If you are using QlikView Components (QVC) then the Qvc.qvs file would be placed within this folder.
If you want to create a data mart to use in further data discovery or as the base in a power user sandbox then you store mart files in the
4.Mart. I would recommend to pre-model your mart in a qvw file for this folder. A set of carefully modelled qvd files could also do the trick, if a
Select * From $(4.Mart)* would give me a correct data model.
5.Configis the home of custom configuration files such as language setups and control documents. The
Local config.qvs of QVC is a good candidate for this folder.
The place to store script files. It could be script files used by the QlikView publisher or by Windows scheduled tasks. This is also a good place for scripts that you manually run for making adjustments or manipulations to you container content.
7.Export path is where you put files generated by QlikView but is to be consumed by another system. Ex. csv or xml files for export to a web service.
8.Import folder like the
7.Exportintended for data transfer between QlikView and other system. This folder is used by the other systems to store their output files. Eg. the response of a web service.
The path for miscellaneous files that you do not fit into one of the above. I could be documentation, document and object extensions used by applications in the container.All folders and sub folders in the QDF contain a Info.txt file. This file contains a short description of the purpose of the folder and the global path variable that will be available while scripting.
Lets say you got your empty container. How do you start?
The key for initiating the QDF is to include the mandatory
init.qvs file into your script. in the
3.Include\BaseVariable folder with relative paths like this.
Depending on which sub folder level your application is located within the 1.Application folder it is considered a good practice to expand the include statement to cover multiple alternative relative paths such as this.
$(Include=..\..\..\..\3.Include\1.basevariable\1.init.qvs); $(Include=..\..\..\3.Include\1.basevariable\1.init.qvs); $(Include=..\..\3.Include\1.basevariable\1.init.qvs); $(Include=..\3.Include\1.basevariable\1.init.qvs); [/qlikview]
By running this script you will initiate the QDF and you will have a set of variables generated into your application. Some of these applications are essential for the framework.
The initiation will generate variables for all your container folders and standard sub folders mentioned above. If you use these variables instead of hard-coded paths in the script you won’t need to be concerned about where your container is located at the moment you run your applications.
Shared and custom variables
If you or someone else have defined shared and/or container specific variables then these will be loaded automatically.
Using the folder structure within a container
If you have initiated the QDF and are ready to go. What’s different when scripting?
Developing in a QDF environment doesn’t need much change in your scripting methods. To get started you should learn to use the path variables instead of absolute or releative paths.
FROM C:/QlikViewFiles/MyContainer/2.QVD/MyData.qvd; LOAD *
LOAD * FROM $(vG.QVDPath)MyData.qvd;[/qlikview]
The QDF also supports fetching variables form other containers. You will notice that per default you will have variables for the Shared container defined for you. You may also import variables from other containers using the following function.
Details on how to set this up is not covered here but is well documented in the QDF documentation.
The main difference between QDF and traditional deployment is in the structure. All containers in a QDF environment have the same folder structure and consists of folders with designated functions. This structure does not have to affect the way you script. You are safe within the QDF as long you
- remember to initiate it with `init.qvs` in every application using relative paths and
- use the generated container variables instead of absolute and relative paths in the rest of your script.
Following these directions will not make you a better QlikView or Qlik Sense developer it will make you survive in the QDF while familiarising yourself with the structures and the functionality that the QDF has to offer.
I’m convinced that the QDF can make improve you and your organization’s QlikView and Qlik Sense developer and administration capabilities. Start of simple by
- Following my two points above.
- Start exploring the folder structure and its content.
- Read the QDF developer guide that is included in the QDF.
- Join and participate in the Qlik Community Group: QlikView Deployment Framework
I believe that you will come a long way with these measures. If you need more help or support contact an QDF expert. If you don’t have one in your organisation then your Qlik Partner.