Application Versioning, what is it and how can be implemented on Qlik SaaS: in this article I will provide all the steps you have to follow!
First of all, what is versioning? Imagine that you are working on a QlikSense application and you do a lot of changes… the most common situation could be when you have to remember the code you wrote two months ago and you didn’t comment the old version … basically, you deleted it and it’s now gone.
(story based on personal real life…. 😀)
In this case, you could ask yourself “why didn’t I do a backup of the application?”, the versioning would meet the question!

QlikSense SaaS provides a very elegant and powerful way to implement versioning, thanks to Qlik Application Automation; if you read my previous articles (if you didn’t, this is an example) , I suggested several ways in order to use Qlik Application Automation.

In this article I will provide as use the versioning, from the point of view of generation; in one of the next articles, I will explain the steps you have follow for import a previous applications’ version.

An important note: on Qlik Saas you can export only applications in a work area, so what you have to do is:

  • create a new application
  • develop your script and sheets
  • publish the application on a managed space
  • After a several time, you have to change the structure of the application (example: script, charts, ….)
  • Before starting with the changes, just to be sure, do a version of you application

Firstly, I created an application which gets a list of ALL the applications in ALL the personal areas of ALL the users (I managed this using Qlik Application Automation, if you want to know more you can write in the comment and I will write a new article about it)

This sheet is strucuted in this way:

  1. App Selector: you will select the desired application to which versioining will be applied (eventually, you can type a specific message in order to remember why you did the versioning)
  2. Export Button: this will trigger an automation which will export the desired application in a github repository
  3. Versioning Logs: this table will show all the versioning you applied across all the applications

While pressing the ‘Export’ button, two main QlikSense variables will be set:

  • appId, it represents the application ID you selected in the dropdown menu
  • v_message, it represents the eventual message you typed in the variable input object

Let’s see in the detail the automation triggered by the export button.

These all the steps:

  • When starting the Auomation, the Qlik Application variable vNow will be set to the current time (e.g. YYYY-MM-DD hh:mm:ss)

  • Two other variables will be set in the Qlik Application Automation
    • appID, will be set as the QlikSense appId variable
    • vMessage, will be set as the QlikSense v_message Variable

This is achieved using the Case Block, passing as parameter the current variable name iterated across the availables

  • Now that we have vNow, appId and vMessage, let’s put all together in another variable, furthermore I’m going to use a list variable denominated vData
  • This is one of the most important phases in this automation, we are goin to “export” our Qlik application.. but where? Actually, the current block will create a virtual export of the application ID (I’m using the AppID variable declared before), keeping in mind that this block returns the app in a Base64 Encoded format
  • The versioning can work if there is a repository on which put the desired application; in this use case, I used Github as repository, so in this block I’m going to create a new file and place it in Github
    • User and Repo are Github related, so they represents the Github user and repository on which place the current exported application
    • Path, it’s also Github related, it represents the current Github path on which the application will be placed; in this case, there is a main folder (apps) , followed by the app id variable (e.g. the application designed for the versioning) and the vNow variable (e.g. the exact moment on which i pressed the Export button)
    • Branch, it’s tipically set on main
    • Message, it’s also Github related, it’s the eventual message inserted before pressing the Export button; it’s pretty useful in order to remember why we decided to do a specific version
    • Base64 file Content, it’s the virtual exported app done in the previous block
  • Do you remember the ‘Versioning Logs’ table? This represents all the times we pressed the “Export” button, but how is it populated? Thanks an excel file, which is powered by this specific block; on my OneDrive, I created a specific .xlsx file with a worksheet and then created a table with 3 fields as Header (app_id, versioning_time, message) … I think you already understood what I’m going to do with this block but, just to be sure, let me explain! I’m going to add the vData variable as a new record in this table, this is done because the variable actually contains 3 values, exactly as the number of field in our table!
  • The following two block mainly set the QlikSense application variables to their default values (e.g. appId variable will be set to “Select an app” and vMessage will be set to ‘message’)
  • At last, after a sleeptime of 5 seconds (I put this block just to be sure that the excel file is correctly updated) , I’m going to reload my start QlikSense Application; this is done in order to have the versioning log table updated

This is how to develop Application Versioning on Qlik SaaS, using Github as repository!

I hope you liked the article 😀