QlikView BestPractice – Keep your solution simple!
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!
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!
- 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!
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 firstname.lastname@example.org
//HINT ONLY PATHS!!!
LET varFileName = DocumentName();
LET varFilePath = DocumentPath();
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 TimestampFormat='DD-MM-YYYY hh:mm:ss[.fff]';
// INCLUDE GLOBAL CONFIGS
After running the script, you already have the follwing variables in your QlikView Document available:
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
- 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;)
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!