Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now

DocuGen - Automatic generation of Qlik Sense app documentation thanks to Qlik Application Automation

cancel
Showing results for 
Search instead for 
Did you mean: 
pchatziag
Luminary
Luminary

DocuGen - Automatic generation of Qlik Sense app documentation thanks to Qlik Application Automation

Last Update:

Dec 9, 2024 10:08:19 AM

Updated By:

pchatziag

Created date:

Dec 5, 2024 10:57:53 AM

ytplayer.png

Download latest version

 

Challenge:

Many of us likely know that after developing a Qlik Sense app, documentation needs to be created to deploy our analysis to production. This process is time-consuming, often requiring several days to produce what feels like just a "piece of paper". Another issue is that documentation is often made using standard templates, leading to materials that aren't complete and can be hard to comprehend. Documentation can be mandatory for both regulatory and operational reasons. Following the idea of “working smarter,” I want to automate this process using DocuGen with Qlik Application Automation (QAA). This approach can save us valuable time, allow us to transfer use cases to production faster, and provide documentation that is both thorough and easy to read.

 

Idea:

It all started with this simple idea and a first prototype, which I built in QAA. Various Qlik Cloud Services blocks are used to extract the relevant metadata from the individual app (e.g. table definitions, sheets and visualizations, variables, measures and dimensions, etc.). This data is then stored in variables and once all the information has been collected it gets passed into a “Custom Code” block. This block uses Python 3.11 and creates a dynamic HTML file without external references. This means that the created HTML file remains transportable and does not require any external resources, as it contains all the necessary functions itself. Finally, the created HTML file is saved to MS Sharepoint.

 

Input parameters for the python script.Input parameters for the python script.

 

Outcome:

This approach enables us to produce standardized documentation significantly more quickly on a daily basis, reducing the time required from an estimated 3 to 5 days to approximately 30 minutes. In my day-to-day job as a BI Specialist, I am now able to transfer analysis prototypes to production much faster for my customers and deliver added value for the business departments even faster. I think many other people in similar roles like me face the same challenge. This is the reason why I created a community project out of this idea together with Dennis Jaskowiak (Qlik PreSales). We started to extend the documentation with more functionalities, generalized the design of the documentation and reworked the code. In this article, we would like to share the project and its content with the Qlik Community.

 

App general information overview.App general information overview.

 

Sheets & visualizations section.Sheets & visualizations section.

 

Data model section.Data model section.

 

Script section.Script section.

 

Content of the package:

The archive consists of only 4 files:

To import the QAA you need the DocuGen v(x).json file. This file contains the exported QAA workspace.

The "code" folder contains the code segments used if you want to customise the code for your needs.

  • custom_code_block.py: This file contains the code that we use in the "Custom Code" blog in the automation.

  • used_css.css: This file contains the CSS definition that we use in the "Variable - vCSS" blog in the automation and imports the style description for our HTML file. The definition is not minified in this file.

  • used_js.js: This file contains the Java scripts that we use in our Python script (custom_code_block.py at the very end). The JavaScript is implemented in the Python code (last <script></script> section). It is important that '{' and '}' are replaced with '{{' and '}}' so that they are not evaluated in Python.

 

Installation:

  1. Create a new blank Qlik Application Automation
  2. Upload workspace (right click on canvas) à DocuGen v(x).json
  3. Create a connection for SharePoint a. scroll to the bottom and click on the “Create File on Microsoft SharePoint” Block that has a red border b. click on the Connection tab and create a connection to your Microsoft SharePoint c. After you receive the information “Connection is linked” you can use it by clicking on your created connection. The connection tab should now change its colour from red to black.
  4. (optional) If you want to switch the number format from ‘comma’ to ‘point’ as decimal separator you can switch the value of the block named “Variable – vNumber Format” from 'de' to 'us'. It’s the second block of the automation.
  5. Now you can run the automation to generate your first documentation

 

Running the automation:

When you click on “Run” the automation gets executed. By default, the automation has configured “Run Mode: Manual”. It requires a few inputs for processing:

  • Space – where the app is located (Personal doesn’t work)
  • App name
  • List of Sections that need to be documented (e.g. Data Model, Measures, Dimensions etc.)
  • Screenshots (yes/no)
  • List for type of sheets (e.g. Public, Community, Private)

If you want to run the automation triggered (e.g. by REST call) it needs to me modified. We will post an example later to showcase this option.

 

Features:

This list showcases what DocuGen covers:

  • General app information:

    • app name, description, Id, Resource type, type of usage, owner, published, published time, space Id, has section access, is encrypted, create date, modified date, last reload time, app memory footprint, app reload peak RAM
  • Data model:

    • For every table it generates:
      • title, number of rows, number of fields, number of key fields, is loose, comment, table size,
      • table containing field name, number of distinct values, number of non-null values, tags, ishidden, iskey, connected tables
  • Measures:

    • For every measure it generates:
      • title, label, description, Id, definition, expression, grouping, custom formatted, format type, format, color, tags
  • Dimensions:

    • For every dimension it generates:
      • title, label, description, Id, definition, grouping, tags
  • Variables:

    • For every variable it generates:
      • title, Id, definition, comment, tags
  • Sheets & Visualizations:

    • list of sheets
      • for every sheet it generates title, type, Id, description, grid resolution, sheet mode, list of used objects
      • link to sheet
    • list of objects on the sheet
      • for every object on a sheet, it generates screenshot, type, Id, title, subtitle, footnote, color mode, color definition, dimensions, measures, link to object
    • if the object is a container (layout container, tabbed container or normal container) it creates a list of all child objects containing the following information:
      • type, Id, title, subtitle, footnote, color mode, color definition, dimensions, measures, link to object
  • Load Script:

    • For every script section it generates:
      • title, script

 

Closing:

This is it for now. I hope this community project can help you automate and reduce the time you spend on documentation. On the bottom of that article, you will find the necessary files. The current version of the files will be hosted on GitHub.

Link to GitHub : LINK

A special thanks to Emil Koslowski (Product Manager Qlik Application Automation) for his invaluable support with various Qlik Application Automation questions. Your efforts have been instrumental in shaping a robust solution. Additionally, a big shoutout to Dennis Jaskowiak (PreSales Qlik) for his genuine enthusiasm for the idea, as well as his mentorship and unwavering support throughout the development - your guidance has been truly instrumental. Thank you!

This project has been created by Prodromos Chatziagorakis (Volkswagen Financial Services) & Dennis Jaskowiak (Qlik).

Comments
Mandy151
Employee
Employee

re:  "Finally, the created HTML file is saved to MS Sharepoint."  If a Qlik consumer does not have SharePoint at their place of work, where else can these files be saved?  And would it change these documentation steps at all other than platform chosen to save docs to?

JonCarpenter
Luminary
Luminary

I have to say, this is one of the most impressive automation projects I've come across. It's incredibly practical, especially for sharing documentation with business partners or team members who may not be as familiar with your Qlik apps. Thank you for this!

sergeyko
Partner - Creator
Partner - Creator

This is looking awesome. I am taking it on a test immediately. Thank you for showing us the art of the possible with app automation.

pchatziag
Luminary
Luminary

@Mandy151 : MS SharePoint is just the utilized platform. Qlik Application Automation offers a wide selection of connectors for exporting the generated html file. Some examples are AWS S3 Buckets, MS OneDrive, DropBox, etc. Changing this last step does not affect the rest of the automation workflow. This is the advantage of the modular design of DocuGen.

@JonCarpenter Thank you for wonderful comment! It is a great deal coming from a Qlik Luminary.

@sergeyko Thank you! I hope you enjoy using it. If you find any difficulties, please us know!

QFabian
MVP
MVP

excelent work @pchatziag 

pchatziag
Luminary
Luminary

The article has been updated to include a link to a YouTube video made by Dennis Jaskowiak. In this video, Dennis shows how to use DocuGen, takes us through the document that was created in the example, and shares some behind-the-scenes information about how the automation works and the logic behind it.

@QFabian Thank you for your kind comment.

Ciya
Contributor III
Contributor III

Excellent work @pchatziag 
My suggestion- This could be good replacement of QSDA Pro if this enhance further by incorporating additional features to identify quality issues of the data model or visualisation flags. This is something missing I feel. 
#DocuGen #QSDA Pro #QliksenseCloud 

EmmaMcAlister
Luminary
Luminary

@pchatziag 
This is very cool! Low effort, high value documentation. It also allowed me to quickly see what elements of an app could be improved with better descriptions.

I'd really like if there was an free text input box in the beginning for some introductory business context. That would need a bit more space than the app description, and potentially with detail not every end user would need to see. 

Thank you for sharing!


PabloLabbeImaps
Partner Ambassador
Partner Ambassador

Any plan to get lineage information like source tables and colums  for each measure and dimension ?

pchatziag
Luminary
Luminary

@EmmaMcAlister Thank you for your suggestion. This is a nice idea. I will consider it for future development. If this is a very important feature that you need, you could already do that by adding your preformatted text directly in the html document and utilizing the existing css rules.

@PabloLabbeImaps Including lineage information is on our bucket list. This is a meaningful addition to the technical documentation. Thank you for your comment.

Version history
Last update:
‎2024-12-09 10:08 AM
Updated by: