Introduction

I develop QlikView solutions now since more than 4 years and I write software since more than 15 years 😉 damn I’m getting old… So as I started to work with QlikView I was more than fascinated by the “easyness” of getting results shown. But als live seems to be simple, the real world hitted me after a fiew months… Don’t get me wrong! I really love QlikView and I think it’s currently the best Business Intelligence Solution on the market, but you need to take care of your development as you always needed to take care of performance, scalability and maintanace! In this article I write down “MY” Bestpractice to work with QlikView – I don’t claim to be the “best” developer, but I try to help out with some cool tipps n tricks on how you get your application stable, seperated into business entities and maintainable! Enjoy!

FOLDER Structure

Before we start within QlikView, I want to suggest you a folder structure, that helped me out for a view customer projects – always keep in mind, that QlikView is a file based solution, storing data into (mostly) qvd-files and displaying data over qvw-files!

  • QLIKVIEW
    • 01 Production
      • YOUR LOGIC
    • 02 Development
      • 01 SUGGESTED
      • 02 APPROVED
      • 03 TEST
    • 03 Adminstration
      • 00 CONFIG
      • 01 DATALOADER
      • 02 DATALOGIC
      • 03 DATASTAGING
      • 04 DATAMART

Here you can see, that for the 02 Development Folder, I try to get in some “workflow” that helps me to keep in track of the status of the QlikView apps!

GLOBAL Configuration

As in every development language GLOBAL_Variables are very usefull and mostly easy to manage! So here ist the first important rule:

Try to keep GLOBAL CONFIGURATIONS in “ONE-File” so changes that affect the whole solution will be managable at ONE SINGLE POINT

So how can you do this in QlikView?!

Paths and Files

As we want to read files and store files into the directory, it’s necessary to get all informations about the current document, the location and all other needed paths for the QlikView app!

Try to make your application PORTABLE using RELATIVE PATHS

To manage the paths I normaly use a file called CONFIG_PATHS.txt in the folder 03 Administration -> oo Config and internally it looks like this:


//COPY Philipp Frenzel BEEYE.ORG 2012 info@beeye.org
//HINT ONLY PATHS!!!

//GENERAL INFORMATION
LET varFileName = DocumentName();
LET varFilePath = DocumentPath();

//PATH DATASTAGING
LET PATH_DATASTAGING = '../03 DataStaging/';

As you can see, we already use QlikView-Script Syntax inside the TXT-File!

HINT: Write your code in QlikView and after it works, copy it into your TXT-File. Advantages: CodeCompletion, SyntaxHighlihting!

To make the GLOBAL Variables available in your QlikView Document, you need to inlcude the following line of code:


SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep='.';
SET MoneyDecimalSep=',';
SET MoneyFormat='€#.##0,00;-€#.##0,00';
SET TimeFormat='hh:mm:ss';
SET DateFormat='DD-MM-YYYY';
SET TimestampFormat='DD-MM-YYYY hh:mm:ss[.fff]';
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';


// INCLUDE GLOBAL CONFIGS
$(Include=../00 Config/CONFIG_PATHS.txt)

After running the script, you already have the follwing variables in your QlikView Document available:

Document Information

Additional to the Path and File-Settings, I alway put some additional information into my files, that helps me to keep track of

  • Document Author
  • Version
  • Created at
  • Last Load
  • Requires (Which Loaders need to be ran before this loader can be started – as my distribution service once crashed, this is a must!!!)

To “fill” the variables, I use the following lines of code:

//GENERAL DOCUMENT INFORMATION
LET varCopy = 'Philipp Frenzel';
LET varCreated = '26-06-2012';
LET varRequieres = 'GeokoordinatenLoader';
LET varLastRun = Now();
LET varVersion = '1.0';

Add other variables as you might need them;)

Logging

As the QlikView Logging is sometimes not really as easy to read or understand, I build up my own “simple” and “individual” logging functionality;) Might look crazy but it works!

 

Leave a Reply