Wednesday, 2 October 2013

How to reload on top of your existing data in your dashboard (bit of a cheat)

Did you know you can use a simple statement to load data back in from your own application? This is handy if you need to tweak data and avoid having to do a large reload.

A binary load statement takes data straight from another QV app and dumps it straight into your file. It's called binary because it takes the exact image of the data as QlikView stores it in a file (bit a like a QVD, but for all the data in an application)

Here I'm using it to load data back into the same app, which can have many uses.

Imagine you are editing an application called My_APP.qvw

At the top of the script, type binary, followed by the filename of your application (yes the same application)
binary c:\users\Erica\Work\My_APP.qvw;

and that's it - it will load all the data from the application. After that, it's up to you what you want to do. Then write statements to add / remove  / manipulate the data and use an exit script statement to stop the rest of the script.

At work, we use this if we need to add a new user quickly to a large dashboard via the section access. Particularly convenient is the fact that the section access is just overwritten each time you call it.

Another great use is to organise your loads on the server - as well as using QVD's you may want to use a standard set of data tables across several dashboards. This would involve 1 QVW

Other things to note about binary are:

 - you can only have one binary statement per load script
 - it has to be before any other data is loaded
 - you can't put it into if statements or program control statements

I hope you find this as useful as I have!


No comments:

Post a Comment