Emulating dynamic labels in Qlik Sense

Currently, in Qlik Sense data columns labels are just static strings that do not evaluate variables and macro expressions. For me, that is one of the most nagging limitations in Qlik Sense.

I’ve made an extension named Dynamator, that adds such functionality to Qlik Sense (albeit with some serious limitations too). As usual, the extension itself and sample application that demonstrates its usage are available for download.

The sample application is somewhat like application in old Emulating cyclic dimension group in Qlik Sense post. Now we have a simple table with one dimension and one measure. We have to make both dimension and measure dynamic. We have “Active dimension” and “Active measure” list boxes to control dimension and measure. We want labels for the dimension and the measure to correspond to active formulas. Sample application

To make dynamic dimension we use the old technique from the same post. For dynamic measure, we load individual formulas for the measure into the island table and then use such formula in the table: $(=MinString(ActiveMeasure)) Load script

That all are the good old techniques that worked well in QlikView and work the same in the Qlik Sense.

Now for dynamic label stuff. We make this work in two steps:

At the first step, we put suitable formulas into the dimension’s and measure’s labels. For the measure in our sample, such a formula would be MinString(ActiveMeasureLabel) Formula in label

At the second step, we add non-visual extension Dynamator to the application and add the same formulas in a property editor of that extension. Formula in Dynamator

Some explanations of the inner working of the Dynamator.

When a sheet is firstly loaded, the Dynamator lookups all objects like tables and charts (but unlike list boxes) in the current sheet. If it found somewhere labels with formulas same as in the Dynamator itself, it links itself to that label and change the label to the value of the evaluated formula. After that, any time Dynamator measures change the Dynamator changes linked labels.

Caveats

So, can we consider that specific problem/feature request in Qlik Sense solved? Well, not entirely. There are some serious problems with such approach.

Maybe in some scenarios, Dynamator could be used anyway. For example, if dynamic labels are used for internationalization they effectively change not so often during a user session. And even if you switch language then table/chart would be probably redrawn just one time (assuming changing the language do not change measure’s formula too).

On the other hand, maybe Dynamator is just the first step to some more effective solution. One of the perspective directions is to use library measures in the table and dynamically switch library measure of the concrete column. Or maybe tomorrow Qlik will announce support for variable evaluation in labels in next version of Qlik Sense and that render all these techniques obsolete.

Links:

comments powered by Disqus