This article demonstrates how to overcome some limitations of the standard Current Selections Box of QlikView: Translating field values, translating “hardcoded” labels of the Current Selections Box, hiding specific fields and customizing the icons shown.
The solution is based on a QlikView object extension I have created, called “Better Current SelectionsBox”.
Motivation
The Current Selections Box has some limitations which I am confronted quite often, probably because I am working in a non English speaking country (Germany).
- It is not possible to translate the field names
- The label of the two columns (“Fields” and “Values”) cannot be translated dynamically
- It is not possible to hide specific fields
(sure, you can use a single HidePrefix in QlikView but sometimes this is not enough) - While the Ajax Clients has some nice flat icons in the meantime, the Current Selections Box still displays some “older” 3D icons
Solution
- Motivation
- Features Overview
- Download & Installation
- Known Issues & Limitations
- Tested with
- Feedback, Bugs & Suggested Improvements
Features Overview
Translation of Fields
Fields will be translated by referencing a loosely coupled table containing the translations. It was important for me to choose this approach because this can be combined with standard best practices to enable multiple languages within a QlikView applications on a per user/selection basis.
Example for loading the translations for each field:
Translations: LOAD * INLINE [ FieldName, FieldName_DE, FieldName_EN Dim1, Dim1 (DE), Dim1 (EN) Dim2, Dim2 (DE), Dim2 (EN) Dim3, Dim3 (DE), Dim3 (EN) ]; Languages: LOAD * INLINE [ Languages, LangKey Deutsch, DE English, EN ];
Then you have to set up your app as follows:
- Place a listbox for selecting the language on every sheet (using the field
Languages
). - Create a variable with the name
vSelectedLangKey
with the expression=Only(LangKey)
- Configure the Better Current Selections Box as shown in the screenshot below
Property | Setting | Description |
---|---|---|
Fields | FieldName |
Select the field name, FieldName is my example above |
Expression | =$(='FieldName_$(=vSelectedLangKey)) |
For the example above this will produce “FieldName_EN” if “English” is selected, “FieldName_DE” if “Deutsch” is selected |
The Better Current Selections Box will then show the translated field names depending on the users language selection:
If a translation for a field name is not available the standard field name will be shown (default fallback mechanism).
Hiding Fields
There are two options to hide fields
- Use Character Prefixes
- Hide fields explicitely by setting their field names
Use the following properties to define which field you would like to hide:
Property | Example | Description |
---|---|---|
Hide Prefixes | _,%,HF |
Hide Prefixes, separated with a comma (,). A single HidePrefix can be a single character or more characters (as shown in the example above with “HF”, so all fields starting with “HF” will be hidden) |
Hide Fields | Languages,OtherFieldToHide |
Define the fields (by setting their field names) to be hidden in the Better Current Selections Box |
An Example:
Icon Style
“Better Current SelectionsBox” supports different Icon Styles which can be chosen in the extension’s property dialog:
General Behavior
There are several options to set the general layouting behavior of the extension:
Property | Description |
---|---|
Show Header | Show/Hide the column header |
Show Values | Show/Hide the values of the current selection |
Show Clear Icons | Show/Hide the clear icons Note: If choosing this value, any standard selections box has to be place on the current sheet |
Show Lock/Unlock Icons | Show/Hide the lock/unlock icons Note: If choosing this value, any standard selections box has to be place on the current sheet |
Show Status | Show/Hide the icon indicating the current status (selected/green & locked/blue) |
This results into several possible rendering status of the Better Current Selections Box:
Download & Installation
Installation of the QlikView extension easy and straightforward, there is nothing special to take care of:
- Download the extension
- Install the extension on your local computer (doubleclick the .qar file)
- Drag’n’Drop the extension within QlikView Desktop (using WebView)
- Finally deploy the extension to your server (-> detailed instruction)
Known Issues / Limitations
Unfortunately …
Unfortunately there was not “direct” way to clear/lock a field without having this field used in a Listbox on the current sheet. So I have tried several workarounds: Finally I decided to use the most generic one. If you have “Show Clear Icons” or “Show Lock/Unlock Icons” enabled you’ll need a “Standard Current Selections Box” placed on every sheet where the “Better Current Selections Box” is used. Unfortunately.
If you “forget” to place a current selections box on the every sheet where the “Better Current Selections Box” is placed the user will see the following error message when clicking on the clear/lock/unlock icon:
Some issues in QlikView Desktop Client
I have experienced some issues in the QlikView Desktop Client when clicking on the clear icons, sometimes the clear command will not be executed correctly, but in the Ajax/Mobile client I have not experiences the same issues
Further limitations
- Alternate States are not supported
Tested With
I have developed and tested this QlikView extension only for the following system:
- Windows x86, x64
- QlikView 11 SR2+, QlikView 11.2 SR1
- Browsers:: Chrome 27, Internet Explorer 9, Firefox 20
Other versions may work fine, but I cannot guarantee …
Feedback, Bugs & Suggested Improvements
Please add feedback, bugs, suggested improvements below as a comment.
16 Comments