We are going to be providing our dashboards and visualizations to directors and senior management – these are people that don’t want to get bogged down in the technicalities of using Qlikview. As such, we should automate the refresh of the data held within our Qlikview dashboards.
To do that, we need to first create an auto reload macro. To do this, click on ‘Tools’ and then ‘Edit Module’. You’ll see the below screen. In this screen, type:
Click okay. Now, we need to create a trigger to fire off this macro. To do this, click on ‘Settings’ and then ‘Variable Overview’.
Within this section, we’re going to create a variable that checks the difference between the current time and the last reload time. Once it reaches a certain length of time, it’ll invoke an ‘OnChange’ event, which will run our macro.
So, add a new variable called ‘vTriggerReload’ and give it the following definition:
=if((Now()-ReloadTime())*1440 >= 10, vTriggerReload+1, 0)
Once you’ve done that, there is just one more step to completing this process. Click on ‘Settings’, then ‘Document Properties’ and select the ‘Triggers’ tab.
Above, you can see that I’ve highlighted our newly created trigger. Click on that trigger and press the ‘Add Action(s)’ button under the ‘OnChange’ title.
Within the subsequent popup, click on “add” and then select “external” as the action type. You can now choose ‘run macro’. Press okay.
In the next screen, just enter ‘ReloadDoc’ in the ‘Macro Name’ box and press okay.
In the “Actions” window that popped up press the “Add” button, select “External” action type, “Run macro” action and press “OK”.
Write “ReloadDoc” in “Macro name” box and press “OK” buttons all the way.
You will need to manually press the data reload button in the first instance. This will then give the macro a date / time to work from, ensuring that data reloads are autonomous.