3 Replies Latest reply: Jul 17, 2016 5:39 PM by Bella Mae RSS

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

    Nik Sitnikov

      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.

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

          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