Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

Set selection indirectly in Qlik Sense (based on variable value).

Hi everyone,

Once again, I am hoping this great community will help me solve my problem.

Is it possible to apply a selection through expression in Qlik? I am trying to apply a selection to an entire dashboard based on a variable value (I create that variable in front-end). Let's say in my data model I have a field in one of the table called Region with 2 possible values (USA and Canada). I then create a variable called vRegion, which could have values of either 1 or 2. Based on a value of this variable, I would like to create a selection for the entire dashboard the same way a Filter would. Can I do that? Maybe with some sort of extension?

I know I can do it with set analysis, but in that case I would need to add set analysis to every single graph in my dashboard which is not realistic. Can I apply a universal selection across dashboard?

Thanks in advance.

3 Replies
bellamae
Valued Contributor

Re: Set selection indirectly in Qlik Sense (based on variable value).

Hi Nik

You might be able to use the below, it was a alternative way of creating a cyclic group.

Create an inline table in the script

DimensionSelector:
Load * inline
[
Selector, Name
'a','NameA'
'b','NameB'
'c','NameC'
'd','NameD'
'e','NameE'
'f','NameF'
'g','NameG'
];

This will create two new fields 'Selector' and 'Name'

Create a master item dimension with the fields being the dimension you want the user to be able to select

if(Selector='a',[Field A],
if(Selector='b',[Field B],
if(Selector='c',[Field C],
if(Selector='d',[Field D],
if(Selector='e',[Field E],
if(Selector='f',[Field F],
if(Selector='g',[Field G])))))))

Use that master item dimension as a dimension in your chart and create a filter pane with the field 'Name' from the inline table.

Selecting a name in the filter pane will make the chart change, as there is no way to limit the selection to just one it is also wise to add a calculation condition on the chart.Calulation condition can be found under Add-ons > Data handling, I use getselectedcount(Name)=1

Not applicable

Re: Set selection indirectly in Qlik Sense (based on variable value).

Hi Bella,

Thanks for your reply. I don't think you understood my question correctly.

I specifically do not want to use a filter. I have a column in my dataset that I would like to filter on. So I could use a filter but instead I want to use a button. There are plenty of extensions for buttons available on Qlik Branch, and they all operate based on variable values.

So my question is how can I emulate filter with buttons through variable values. If variableA = 1, apply a certain filter. How can I do this in Qlik?

bellamae
Valued Contributor

Re: Set selection indirectly in Qlik Sense (based on variable value).

Sorry I don't use extensions and although I used them in Qlik View I have not needed buttons in Qlik Sense so far. Hopefully someone else will be able to help you

Community Browser