Best Practice - Binary Loads

If you're using Vizlib Writeback Table or Vizlib Input Form, you want your reloads to be optimized and as quick as possible.

If your app reloads time is longer than 30 seconds you might want to try working with binary loads to improve the reload time. For an overview of the Binary Load structure please see the Qlik Sense article here. You can find the full Qlik Sense reference article for binary statements here.

This topic contains the following sections:

Binary Loads - Benefits

Binary loads can improve speed and performance, which will help you work with your data more effectively. This is because every time you perform a writeback operation, a reload operation is also required. Binary loads will speed up the reload process, which is where the improvement in performance can be measured.

Note: If you do encounter a Reload Error when using Vizlib Writeback Table, please check our Troubleshooting guide here (https://community.vizlib.com/en/support/solutions/articles/35000167040).

How to Create a Secure Binary Load

Simply by using a Folder Data Connection which points directly to one app. Creating a data connection to the working directory is not secure since it exposes all the apps in the environment.

Creating one Data Connection per Data Model, provides a granularity fine enough to easily manage who has access to which Data Model. The Data Model app can then be published in a stream that is only available to the Data Team and refreshed using the standard task management, and the Data Connection gives access to the Data Model app, without having to give access to the app itself.

Moreover, thanks to Qlik Sense Enterprise architecture, the app will be synced automatically to all nodes of the cluster.

  1. Create a folder Data Connection. It does not matter which folder is configured at first into the hub, it will be changed.

  2. In the QMC, edit the Data Connection just created and change the “folder” by the path to the app (inside the working directory. e.g. D:\Apps default working directory is C:\ProgramData\Qlik\Sense\Apps)

Figure 1: Binary load data connection for the app with id 193dc96e-0f97-4184-aa76-1a2c08853f4f

  1. Using the security rules, give access to the Data Connection to the appropriate users.

  2. Use the following binary load in every app based on this Data Model. Important note there is no file specified, there is no need to as the Data Connection already contains it.

In Qlik Sense, the binary statement loads data from another Qlik Sense app, including section access data. It must be placed at the very beginning of the script, and only one binary statement per script is permitted.

Binary [lib://Data Model - Example];

How to Convert a Writeback App to Use Binary Load

Converting a Writeback app to use Binary load is simple. What you need to do:

  1. Is duplicate the application (writeback app) and change the name to something with Binary.

  1. Remove all the script in the binary app that is related to loading the writeback data or doing an action depending on changes in the writeback data e.g. setting variables values, transformations.

  2. Setup a secured data connection to the binary app.

  1. Publish the binary app and modify the reload task of the writeback app to reload the binary app instead.

  1. In the writeback app add the binary statement (e.g. Binary [lib://Data Model - Example];) to the very beginning of the script.

  2. Do the opposite of point 2, remove all the script that is not related to loading the writeback that is being loaded through the binary app.

  3. Done! Now when doing writebacks the reloads should be much quicker.

Figure 2: Loop & reduce demo app data model.

If you want to see how it's configured in an existing application, please check out the Finance Adjustments demo app here or the demo applications attached to the Loop and Reduce article.

Binary Load vs. Partial Reload - Comparison

Partial reload can sometimes be used as an alternative for app reloads, as it can match binary load for speed. We've included a short comparison here.

Binary Load (Recommended)

Partial Reload

  • Requires changes to the load script because not all script functions are supported during partial reload.

    • Tables that are not loaded during the partial reload are not available during the partial reload. This means that transformations and lookup will break the reload.

    • An if-statement with Not IsPartialReload() needs to be wrapped around code that should not be executed

  • Starting a partial reload is currently only be supported using the Qlik Engine JSON API. This makes it harder to develop since you can not start a partial reload from the Data load editor.

  • Debugging partial reloads when they fail requires a review of log files, which is more difficult than being triggered from the Data load editor.