NOTE: Links in this post are to deprecated versions, please see the QlikView Notepad++ page for the latest version and instructions.
I've been working on a project for the last few weeks which has required me to use a lot of separate QlikView script files. For those that don't know, it is possible to include text files containing QlikView statements into the script of a QVW using the following statement:
The lines in the separate file will be included in the QVW script at the point of the include statement and run as if they were in the QVW script. Note that the file extension is not important but .qvs is the extension QlikView uses when you ask it to export the script from a QVW so I generally stick to using the same. Using separate script files can be a really powerful tool when trying to perform the same data loading and manipulation tasks in multiple apps. Changes can be made to the script file once rather than having to make the same change repeatedly in the multiple applications where its used.
Anyway, on to the real point of this post. I like to use Notepad++ as my text editor when working with XML, HTML, etc and so naturally that's where I went to create my QlikView script files. But I quickly became annoyed that the nice QlikView syntax highlighting that I'm used to when working in QlikView Desktop was missing, making reading and editing the script much harder. So with a spare half an hour I created a Notepad++ custom language definition for QlikView and thought I'd share it so others can benefit too. Its by no means perfect and won't give you an exact representation of the script as you would get in QlikView's Edit Script dialog but it will highlight comments, functions and most keywords. It supports the following:
- All current QlikView functions
- Most commonly used keywords
- Line comments (//) and block comments (/* */)
InstallationHere are the steps to getting it installed and working yourself:
- If you don't already have it, you can download Notepad++ from http://notepad-plus-plus.org/download/. Its completely free and a great text editor. If you are running an older version I'd recommend you upgrade to the latest as some older versions can't import language definition files and so you'll get stuck with the next steps.
- Download the QlikView language definition XML file from http://qvacb.googlecode.com/files/qlikview-lang-def-v0.3.xml.
- Open Notepad++ and navigate the menu to View-> User-Defined Dialog...
- Either a floating window or a panel to the right will appear, click on the "Import..." button within it.
- Navigate to the location where you saved the XML file to and select it and click "OK".
- Hide the language panel by again selecting View-> User-Defined Dialog... on the menu.
And that's it! Happy QlikView scripting.