3
 min read

Charts with dynamically showing/hiding measures

Unfortunately up to today, there is no show-condition in any Qlik Sense chart other than the pivot table and straight table, but with this trick you can dynamically show / hide certain measures in any chart.

Maybe you know the "show-condition" field in every column, dimension or measure, within a table object? Cool! This allows the developer to tie the visibility of certain columns to - say - a toggle (variable button), which the user can change. That way, you can turn a complex table into something lighter, when you group some columns. Now, when you turn such a table into a chart, the "show condition" is gone and it is ignored if it was filled before. Until further notice, this isn't implemented.

I wanted several measures (e.g. lines) to be optionally visible. There is a dirty trick to introduce a 2nd pseudo dimension like ValueList('Value','Average','Trend') and a complex formula in the measure then could pick the right formula for the corresponding pseudo dimension ... but ... that's not nice. Especially, when you want to style the lines differently, one thicker than the other, one dashed, ... then you're stuck here.

The solution is to add all measures into a chart at once, drag it into the Master Visualizations and then to use my latest extension "/\Master Vis Changer". It reuses your chart, renders a checkbox-group above or below for each measure (=e.g. each line) and makes calls to Qlik's Visualization API with the right number of measures. Pretty straightforward as you can see in below animation: