I am a beginner using Qlik Sense Desktop to make a panel which (ideally) should be as similar as possible to another panel. The panel I am trying to mimic has an option of what I believe to be a filter pane presented as a drop down menu. The figure below (the texts are in Portuguese) shows what I am trying to mimic, and was taken from here, after you click in "Visão Geral":
I know I have the option of creating a filter pane one tile high. This way, the field name would be displayed and when the user click it the values will be shown. However, if possible, I would like something closer to what was shown in the Figure. I tried installing Vizlib library as suggested in this post, but the filter style remains the same.
How can I make a filter pane appear as a Drop down menu in Qlik Sense? Thanks in advance.
You can use a combination of the Variable Input object, a variable, the Concat()
function, and Set Analysis to achieve this.
The basic idea is that the Variable Input object will be in Dropdown mode with a list of all the available values of the [Setor]
field, the selection of which will update our variable, which will be expanded in a set expression in each chart measure that we want to affect with this dropdown.
vDropdown
and set the default value to Todos
.Under the Variable tab, choose our new variable from the list, then select the Dropdown option.
Under the Values tab, choose the Dynamic option. In the box below it, add this expression:
='*~Todos|' & Concat(all distinct [Setor] & '~' & [Setor], '|')
Here's what this is doing:
*~Todos|
part is using the asterisk as the wildcard character as the underlying value and the word Todos as the displayed value. The asterisk wildcard character will be useful to us when we get to the set analysis step.Concat(all distinct [Setor] & '~' & [Setor], '|')
part is using the Concat()
function to combine the all
of the distinct
values of [Setor]
separated with the pipe character |
. The tilde character ~
is used here to separate the underlying values with the displayed values (this only really matters with the first thing we did).Use this expression:
{<[Setor]={"$(=Coalesce(EmptyIsNull('$(vDropdown)'), '*'))"}>}
So you would use it like this:
=Sum({<[Setor]={"$(=Coalesce(EmptyIsNull('$(vDropdown)'), '*'))"}>} [Processos])
Here we are using our vDropdown
variable inside of a set expression. Basically what it's doing is to set the [Setor]
field to whatever is selected in our dropdown unless our variable is NULL
, in which case it just returns an asterisk *
. This works for us because when you use an asterisk in set analysis (like this --> "*"
) then you're basically telling Qlik to return "all non-NULL
values."
That should be enough to make it work: