Better Current Selections Box to Translate & Hide Fields (QlikTip #49)

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

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:

  1. Place a listbox for selecting the language on every sheet (using the field Languages).
  2. Create a variable with the name vSelectedLangKey with the expression =Only(LangKey)
  3. Configure the Better Current Selections Box as shown in the screenshot below

Language Configuration Properties

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:

No Language Selected - Fallback Scenario

Language German selected - Fields are translated to German

Language English selected - Fields are translated to English


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:

Hide Fields in the 'Better Current Selections Box'

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:

Hidden Fields Based on HidePrefixes and FieldNames

Icon Style

“Better Current SelectionsBox” supports different Icon Styles which can be chosen in the extension’s property dialog:

IconStyle Property

Icon Styles of the Better Current Selections Box

General Behavior

There are several options to set the general layouting behavior of the extension:

General Layouting Options

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:

Full Feature Set

Hide Values

Hide Status Icon (Selections=Green/Locked=Blue)

Hide Header

Hide Clear/Lock/Unlock Icons

Hide Clear Icon

Download & Installation

Installation of the QlikView extension easy and straightforward, there is nothing special to take care of:

  1. Download the extension
  2. Install the extension on your local computer (doubleclick the .qar file)
  3. Drag’n’Drop the extension within QlikView Desktop (using WebView)
  4. 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:

If you choose “Show Clear Icons” and/or “Show Lock/Unlock Icons” place any standard “Current Selections Box” on the current sheet. You can hide the object (Show Condition = 0), so it will not be shown to the user, but the “Better Current Selections Box” relies on any Current Selections Box on the current sheet. Unfortunately …

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.

Bookmark and Share

and tagged , , , . Bookmark the permalink. Both comments and trackbacks are currently closed.

16 Comments