# Dimensions

## `Readonly`

**Description:** A non-editable text input that can be used to present a value directly from a Qlik Field

<figure><img src="https://4099892881-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXdGSelEVi2ug2LCBzJx5%2Fuploads%2FiJ5aGVTaRrquMonMpDL1%2Fimage.png?alt=media&#x26;token=551df5f4-0d70-45b9-bff0-4edd1851fb8d" alt=""><figcaption></figcaption></figure>

####

{% hint style="warning" %}
To be sure not to have any conflicts with Qlik's data load, try to avoid special characters such as '/' or '<>' in your Komment Key Fields
{% endhint %}

**Display as URL:**

For Readonly widgets it is possible to choose to display the content as a clickable URL.

In the Komment table the user will be able to click on the URL which will open up in a new tab:

<figure><img src="https://4099892881-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXdGSelEVi2ug2LCBzJx5%2Fuploads%2FJoXaUh4a2Y5JTqki41rY%2Fimage.png?alt=media&#x26;token=5bd647de-a558-4e64-a88b-8c53cc825769" alt=""><figcaption></figcaption></figure>

## `Text`

**Description:** Plain text input, mainly for free text.

<figure><img src="https://4099892881-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXdGSelEVi2ug2LCBzJx5%2Fuploads%2FhLMGuBqZuyUY3v2pyHzB%2Fimage.png?alt=media&#x26;token=856c1588-6963-4da4-ba2b-10837fe2e113" alt=""><figcaption></figcaption></figure>

**Options:**&#x20;

* Choose between a single line or multiple line display
* Ability to limit the maximum number of characters a user can write

## **`Date`**

**Description:** A date picker to easily select a date from a calendar view

<figure><img src="https://4099892881-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXdGSelEVi2ug2LCBzJx5%2Fuploads%2FVmLqG48zx1Z0WiAAfjYT%2Fimage.png?alt=media&#x26;token=de191842-fd35-49c2-b40e-89e0232c41f2" alt=""><figcaption></figcaption></figure>

**Options:**

* Select via a calendar view
* Type date directly in widget
* Define the format in which the date should be displayed

## `Dropdown`

**Description**: A drop-down menu with configurable options as input data

<figure><img src="https://4099892881-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXdGSelEVi2ug2LCBzJx5%2Fuploads%2F1T6oqgKgCEFzqU1I5H3Z%2Fimage.png?alt=media&#x26;token=b04c9223-52d9-4b57-a4b0-6f3ecb0259c6" alt=""><figcaption></figcaption></figure>

**Options**:

* Define possible values manually
* Load possible values from Qlik data field or variable (e.g. use the **concat** function like this in the Options field: `Concat(distinct [First Name],';')` )
* Enable a search option for the users
* Enable users to add their own options in case the possible ones are not sufficient
* Allow for the selection of multiple values

## `Group Button`

**Description**: Similar to the Select option but renders the options as grouped buttons

<figure><img src="https://4099892881-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXdGSelEVi2ug2LCBzJx5%2Fuploads%2FFIW2TqtwatTZUsOaAHaj%2Fimage.png?alt=media&#x26;token=dd5d01d5-d419-4291-b61d-26de8eaffa81" alt=""><figcaption></figcaption></figure>

**Options**:

* Define possible values manually
* Load possible values from Qlik data field or variable (e.g. use the **concat** function like this in the Options field: `Concat(distinct [First Name],';')` )
* Define colors for each button

## `Number`

**Description**: A numeric input field formatted as a number

**Options**:

* Define **Number Type**. Can be set to either Number or Percentage
* Define number of D**ecimals** to be included
* Enter number directly in input field
* Toggle number up and down directly in widget

## `Check`

**Description**: Works as a check box to easily indicate e.g. completion of a task

<figure><img src="https://4099892881-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXdGSelEVi2ug2LCBzJx5%2Fuploads%2Fcd9foldeOElaN1d5hDYW%2Fimage.png?alt=media&#x26;token=81c9874e-9362-4ca2-9072-8cb3033f9454" alt=""><figcaption></figcaption></figure>

## `Validation expression`

**Description**: This feature can be applied to any dimension. Use this for any conditional checks before saving the input. A validation expression is required here to check if the input data is fulfilling requirements and limits. Check the other dimension’s content by evaluating the binding variables in each widget.

<figure><img src="https://4099892881-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXdGSelEVi2ug2LCBzJx5%2Fuploads%2Fq1L3QlMTzEmzsVRyrqeL%2Fimage.png?alt=media&#x26;token=9ae68523-8795-4005-9885-23a1ae68ecd4" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4099892881-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXdGSelEVi2ug2LCBzJx5%2Fuploads%2FOF7Qfpld8ppiPe58Ssj4%2Fimage.png?alt=media&#x26;token=afe60494-5ad5-409c-b07e-09658cf71850" alt=""><figcaption></figcaption></figure>

**Options**:

* Define exact expression to be used for a given validation step - e.g. only allow for 1 record to be saved each time.
* Define the desired message the user should be presented with when the validation expression is not met.

####

#### 2.1 Add dimensions

<figure><img src="https://4099892881-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXdGSelEVi2ug2LCBzJx5%2Fuploads%2F8fMGNJ8Mj3fxEaDnJ4QS%2Fimage.png?alt=media&#x26;token=f369ef81-826a-40e5-8736-1a47ff7497f6" alt=""><figcaption></figcaption></figure>

#### 2.2 Define dimensions

<figure><img src="https://4099892881-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXdGSelEVi2ug2LCBzJx5%2Fuploads%2FQpB52s3Oz1LaIUyfJ2Di%2Fimage.png?alt=media&#x26;token=930ee1e4-7bda-4a00-b6a0-5e872c40e3e8" alt=""><figcaption></figcaption></figure>

`Dimension Type:` Select your dimension type.

`Fiel:` 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.

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

Continue this for all the dimensions you want to add.

{% hint style="warning" %}
We recommend to place the dimension holding the Komment Key Field as the first dimension.
{% endhint %}

### 3. Finalize configuration

#### 3.1 Preview Load Script

Go to Shortcuts => Press `Preview Load Script`<br>

<figure><img src="https://4099892881-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXdGSelEVi2ug2LCBzJx5%2Fuploads%2Fec50O8BDZ4qFBz7I1YnA%2Fimage.png?alt=media&#x26;token=14aacf30-b01e-4ab3-a225-340670224c46" alt=""><figcaption></figcaption></figure>

#### 3.2 Initialize Data Model

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

<figure><img src="https://4099892881-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXdGSelEVi2ug2LCBzJx5%2Fuploads%2FKDG7VhEMcACS9aWyFzk3%2Fimage.png?alt=media&#x26;token=73273c1a-b239-4408-8897-13ccecdaa7c9" alt=""><figcaption></figcaption></figure>

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

{% hint style="success" %}
That's it! You have now successfully configured your write-back solution.
{% endhint %}

{% hint style="info" %}
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.
{% endhint %}

#### 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:

```javascript
//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.
