Configuration

Time to complete: 3 minutes

1. Setup

When setting up the Komment object ensure that you do not have the data load editor open in a separate browser tab.

1.1 Base settings:

General settings

Mode: Default mode is Table. Select Form or Popup if desired.

Fact Table Name: Select the table from your data model on which you want to relate your write-back to.

Date Format: Select the date format you wish to have your date selector values shown in.

Writeback Variable Name: Ensure to name unique if you have multiple Komment objects in your app.

Writeback Table Name: The name of the QVDs that are stored. Ensure to name unique if you have multiple Komment objects in your app or different apps are storing QVDs to the same location.

If you wish to store your QVDs in a subfolder to a given data connection you can change this in the load script later. This is recommended if you have multiple apps which uses Komment.

1.2 Transports:

Define Transports

Transport Type: Select between QVD and MS SQL (only available with Kaptain service)

Active: Choose whether the given Transport should be enabled or disabled

QVD Data Connection: Select the data connection where you want to store your QVDs

QVD Storage: This defines whether your data is stored into one QVD or separate QVDs.

1.2.1 MS SQL setup:

Step 1 - Kaptain Configuration file:

The system administrator must setup the proper settings for the MS SQL DB to be used by Komment. This is done in the Kaptain configuration file that is installed together with Kaptain.

Default location: C:\Program Files (x86)\ExtendBI\Kaptain\config\default.json

The configuration file should be setup with a section related to MSSQL:

"mssql": {
"MSSQL_SERVER": "localhost",
"MSSQL_PORT": 1433,
"MSSQL_USER": "Sa",
"MSSQL_PASSWORD": "Abc12345",
"MSSQL_DATABASE": "Kaptain",
"SQL_ENCRYPT": false
}

Step 2 - setup MS SQL transport in Komment:

You should finalize your widget setup in section 2 below and then come back to finalize your MS SQL transport in this section.

  • Under Transport Type => Select Microsoft SQL Server

  • If you have created a table in your SQL DB with the columns corresponding to your defined Widgets, you can select this table under the Table Name dropdown.

  • However, it is even easier to create the relevant table in your SQL DB directly from Komment. Just press Create SQL Table and enter a name for the table. Afterwards you can select the table from the Table Name dropdown menu.

2. Widgets

In this section you simply define which fields you want to make it possible to edit and how they should be editable. You can see a full description of each widget type in the Widget section under Features.

2.1 Add widgets

Add new widget

2.2 Define widgets

Define widgets

Widget Type: Select your Widget type.

Mode: Choose between Field or Expression

Qlik Field Name: Select the relevant field name from the defined Fact Table.

Komment Key Field: If your selected field is the association between your data model and write-back data then check this field.

Widget Label: Define the label for the widget. If nothing is entered the Field Name will be displayed.

Continue this for all the widgets you want to add.

3. Finalize configuration

3.1 Preview Load Script

Go back to Setup => Press Preview Load Script

Preview Load Script

3.2 Initialize Data Model

You will now be presented with the auto-generated Komment load script as shown below.

Initialize Data Model

Now press Initialize Data Model. Komment will now automatically inject the script in your Data Load Editor and do a reload of the application.

That's it! You have now successfully configured your write-back solution.

Qlik Engine has a known issue that can occur when initializing the data model. This error warning can safely be ignored as the data model will be initialized correct.

3.3 External script

If you want to externalize the Komment script section and use variable based path, you must ensure that the variable is not cleared out after must_include/include function:

//Set script path
LET vScriptPath = ‘lib://myScriptFolder’;
//Include komment logic in qvs file
$(Must_Include=[$(vScriptPath)/Writebacks/Komment.qvs]);
//Clean variables
LET vScriptPath = ‘’;

In above case, Qlik will run into an error when reloading. That’s because Qlik will firstly execute the ‘Clean variables’ part rather than ‘Include’ function. So the suggestion is to either move the clean logic into a qvs with include or remove it if not necessary.