Qlik Deployment Framework-QlikView Getting Started Guide
Qlik Deployment Framework-QlikView Getting Started Guide
April, 2017
qlik.com
Table of Contents
Why a Framework? 3
Standards 3
Qlik Deployment Framework 3
Qlik Deployment Framework resource containers 4
Locale files 7
Sub Functions 7
Linking (mount) Containers 7
Default containers 9
Why a Framework?
Standards
It’s important to have and use standards when developing and maintaining a development platform. There
are many ways of getting the same result, but not all of them are efficient and understandable. By use of
QDF in combination with guidelines it’s possible to create a cohesive multi development environment.
With the introduction of Qlik Deployment Framework building and managing Qlik deployments becomes
easier and more efficient, for not only IT but professional services as well. QDF is a set of guidelines and
utilities that enable: Resource Sharing, Reuse, Organization, Structure and Standards providing an effective
and efficient deployment including both QlikView and Qlik Sense. The Qlik Deployment Framework (QDF)
design and documentation is based on knowledge gathered from real life scenarios.
QDF is based on the concept of resource containers. This is building blocks and security separators that
is aligned to fit the current needs. when demand changes its easy to reorganize and add additional
containers. QlikView and/or Qlik Sense applications are hooked into the containers in which all needed
resources are resided. Each container has identical file structures and contains predefined script functions.
Classic Container (default) has same container layout as traditional QDF (from version 1.0)
Qlik Sense Only Here we have removed everything related to QlikView, for example Application
and mart folders. Extract, Transform, Load folders have also been added under the QVD structure.
Slimmed Down is intended for smaller deployments and several folders have been removed.
Extract, Transform, Load folders have also been added under the QVD structure.
Administration container it’s from here additional containers are created and managed.
Shared folders. A fresh QDF installation always contains a shared container, this is a repository to
store scripts, configuration and data files that are shared and reusable by all applications.
Example This is a container containing some examples and QVD files, this is used during the
exercise documentation.
As mentioned earlier Qlik Deployment Framework applications need to have an initiation include statement
in the beginning of the QlikView script.
1. Create or save QlikView application (preferably in a subfolder) under 1.Application folder in the
container.
2. Create a first Tab called Qlik Deployment framework and Paste in the initiation script code below.
Let vL.InitLinkPath = Left(DocumentPath(), Index(DocumentPath(),
'\1.Application'))& 'InitLink.qvs';
$(Must_Include=$(vL.InitLinkPath));
3. Reload and check in QlikView Variable Overview for Global Variables (vG.xxx) pointing into the
container folders, as shown below:
4. These variables are used when developing instead of hardcoding or using relative paths. The
benefit is that applications can be moved in all directions without breaking the script.
Locale files
Contains include files with parameters that defines language, country and any special variant preferences
that the user wants to see in their user interface. The locale global variable is vG.localePath.
Use this folder for custom Locale settings as well.
// Locale for US English
$(Include=$(vG.LocalePath)\1.US.qvs);
Sub Functions
Qlik have the possibility of reusing scripts and functions by using the Sub and Call commands. As
presented below with the LCGV function. The Framework contains library of nice to have functions. All sub
functions are stored under the 3.Include\4.Sub folder and are initiated during QDF initiation.
Use Call function_name(‘Input parameters or variables’) command to execute the preloaded function.
Another function example, vL.FileExist will return true of false depending on if the file exists
Call vL.FileExist ('$(vG.QVDPath)\SOE.qvd')
Example: call LCGV('AcmeTravel',’QVD’) Will create all Global Variables linking to AcmeTravel
QVD folder. Variables created will have similar name as home container but with the additional AcmeTravel
prefix in the variable name, like vG.AcmeTravelQVDPath for QVD path to AcmeTravel container
call LCGV('Oracle','QVD;Include'); Will create two Global Variable links to different resources in
Oracle container, by using an additional switch and ‘;’ separator creates Global Variables
vG.OracleQVDPath and vG.OracleIncludePath (instead of linking all folders as in the first example).
Qlik have the possibility of reusing scripts and functions by using the Sub and Call commands. As
presented above with the LCGV function. The Framework contains library of nice to have functions.
The function reference guide is available as a separate document Qlik Deployment Framework-Function
Reference Guide.pdf. As the sub functions are identical to both Qlik Sense and QlikView the same guide
applies to both platforms.
Best practice is to keep the connection strings in a separate Include file, this behavior is supported by QDF
(Qlik Sense is not using connection strings). Use the Global Variable vG.ConnStringPath to connect inside
your container, example:
If the connection string is in another container like the Shared folders container use the Global Variable
vG.SharedConnStringPath to connect, example:
// Connection string to Northwind Access data source
$(Must_Include=$(vG.SharedConnStringPath)\0.example_access_northwind.qvs);
After Framework basic installation (using the Deploy Tool) pre-installed containers are:
Administration container named 0.Administration. This container contains admin stuff like Variable
Editor, System Monitor. This container is used for administration of all the other containers.
Shared folder container named 99.Shared_folder. This container is used for company shared
applications, kpi’s and common Qlik data files (QVD) like Active Directory data.
Example container (Optional) (1.Example). Containing example applications to understand how
QDF development works. When getting started browse through the example container, look at
example scripts and read the information inside the folders.
Administration container includes more folders than the other containers, like framework templates, batch
scripts and admin tools. The folder 0.Templates (zero in the beginning) stores templates and exists only in
0.Administration container.
Administrative applications
Administrative container is pre-configured with administrative applications:
Variable Editor adds and modifies Custom Global Variables and System Variables.
Variable Editor also edits, modifies and creates new containers based on the Container Map.
Read more in Variable Editor Section. Variable Editor Resides under 6.Scripts\2.VariableEditor
QlikView System Monitor preconfigured for Deployment Framework. Is used for monitoring the
QlikView Environment. Resides under 1.Application\2.QlikViewSystemMonitor.
QlikView System Monitor is depended on the settings in SystemSettings.qvs Include file.
Index Monitor This tool will load in and monitor qvd meta-data index created by the index function
built into QDF. Works for both Qlik Sense and QlikView.
Shared Global Variables are loaded by the Initiation script 1.Init.qvs, so the shared folder variables are in
the applications without loading any special script. Shared Folders container does not need to have the
physical name 99.Shared_Folders, as long as a container is defined (in the Variable Editor) with the Prefix
(tag) Shared will the container be treated as a shared repository.
Resource Containers
All containers (except Administration) are Resource Containers. Resource containers are created by the
Variable Editor or Deploy Tool and have a green container icon.
Load and store company QVD data by using the vG.QVDPath Variable.
Store company specific connection strings with vG.ConnStringPath Variable.
Load and distribute end user applications.
Load and share Qlik Marts to developers and/or power users with vG.MartPath Variable.
Store configuration files in vG.ScriptPath.
Export data from Qlik to 7.Export folder by using vG.ExportPath Variable.
Store import data in 8.Import folder, load into Qlik with vG.ImportPath Variable.
Use as Self-Service Containers
After the initial installation it’s possible to enhance the framework (add containers) using the deploy tool.
Active frameworks are identified automatically when adding a correct URL. Deploy tool will store last used
URL to make it easy.
1. When active framework is found the Deploy path text will change to Active Root Path. Also
Documentation and Example Container check boxed will be removed.
2. From the Containers grid additional containers can be typed and generated
3. Container properties:
Prefix (Mandatory) this is the Container identifier, this is a unique short name for company
department or project. This is used when mounting containers within the Qlik Scripts. Do not
use long names or spaces
Container Name (Mandatory) this is the physical container name shown on disk, could be
company department or project. This could also include subfolders within the framework,
examples:
1.AcmeSales
100.DataSources\1.SQL-DB
Variable Editor is a QlikView application that graphically controls Deployment Framework. System and
Custom Global Variables can be added and edit within Variable Editor and all containers are plotted in a
Container Map (master is stored in Administration container) this map is edited and containers created
using Variable Editor, start by clicking on the Variable Editor Shortcut. If using User Access Control (UAC)
right click on the VariableEditor.cmd and run as Administrator.
Edit or modify container map in the table, remember that it’s only the container Map that is changing not the
physical container structure.
Retrieve Backup
Use Retrieve Container Map Backup to get back to the backup stage.
Shows physical containers that exist within the Container Map Container that exists in the Map and not in
real life will be shown as Orphans as shown in the example below:
Global Variables
The Global variables are modified by the Variable Editor and I stored in
$(BaseVariablePath)\CustomVariables.csv files in each container. Global variables (with the prefix vG.) are
loaded by default into Qlik during the framework initiation process in the beginning of the script (read more
in using Deployment Framework Containers). Global variables should only be used when a variable is
shared by several applications in a Container.
Universal Variables
System Variables are actuary also Global Variables that start with (vG.), the difference is that System
Variables are predefined variables used to store system settings like QlikView Server log path. System
Variables are also not preloaded, 3.SystemVariables.qvs include script needs to be run to load in the
System Variables into QlikView.
System Variables are modified by the Variable Editor and I stored in
$(BaseVariablePath)\SystemVariables.csv. There is usually only need for one System Variable version, the
main is stored in 0.Administration container and is by default replicated out to the other containers.
Custom Global Variables will automatically be loaded into Qlik applications when using Deployment
Framework. Each Container has its own Custom Global Variable file that the applications use.
For Global Variables that need to be used across containers modify Shared Custom Variable file with
Variable editor.
Retrieve Backup
Use Retrieve Backup to get back to the backup stage created by Change Variable File and Create a
Backup button.
Update Variables
Use this button to apply the new variables after adding and/or modifying.
Variable Editor has the possibility to add variable files into the selected container in addition to the default
Custom Global Variables. Type the variable filename into the Add Variable File input box and press enter
like example below:
The Refresh and Create a Backup box will now change to a Create Variable File box
When pressing apply the new csv file (empty) will be created as HR_KPIVariables.csv and stored under
selected container 3.Include\1.BaseVariable.
To remove a Variable File add the command del before the filename and run the script like example below:
Variable files other than Custom Variables will not be loaded by 1.Init.qvs into the applications by default.
Add Sub Function below into the application script instead:
$(Include=$(vG.SubPath)\2.LoadVariableCSV.qvs);