Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Not applicable

Can we change the dimension of a bar chart with a parameter in qlik sense?

This is the functionality similar to the parameter capability in tableau where there is a someone could select say customer, buyer, or territory and the colors of a bar chart would split by customer, buyer, or territory or whatever they selected. Is this possible in qlik sense?

Thank you ahead of time

1 Solution

Accepted Solutions
brunobertels
Valued Contributor

Re: Can we change the dimension of a bar chart with a parameter in qlik sense?

Hi

See app attached it gives a simple example of cyclic group using variable and the way to change colors of bar chart depending of the dimension.

Regards

Bruno

12 Replies
bellamae
Valued Contributor

Re: Can we change the dimension of a bar chart with a parameter in qlik sense?

I think what you are looking for is called a cyclic group, these are a built in feature of QlikView but not Qlik Sense. It is possible to create the effect with inline tables and buttons but it is clunky and can slow down performance.

Not applicable

Re: Can we change the dimension of a bar chart with a parameter in qlik sense?

Yes Bella this is what I was thinking about, I just couldn't remember the name.

Could you elaborate a little bit more on inline tables and buttons?

Thank you

Not applicable

Re: Can we change the dimension of a bar chart with a parameter in qlik sense?

You could use extensions: Makes Sense to go round in circles

Alternate States could also help (i remember seeing links about it as it is new to Qlik Sense v2.2 - can't find them right now!)

It would also be possible with a Variable - although a little more complex:

In your Load Script create a separate table (make sure the field name does not match any existing field names - so there is no join) which lists the Dimension you want to choose from, with an incrementing number relating to it

Create a variable, which is: =IF(MAX([YourDimensionListNumber])=1, [FirstDimension],etc.

Then setup your bar chart to have the variable as a Dimension and add a Filter, with [YourDimensionListName] in it. Then when you choose an option from this list, it will show that dimension. It you select more than one option, it will choose the last one.

Not applicable

Re: Can we change the dimension of a bar chart with a parameter in qlik sense?

brunobertels
Valued Contributor

Re: Can we change the dimension of a bar chart with a parameter in qlik sense?

Hi

See app attached it gives a simple example of cyclic group using variable and the way to change colors of bar chart depending of the dimension.

Regards

Bruno

saniyask
Contributor

Re: Can we change the dimension of a bar chart with a parameter in qlik sense?

Hi Bruno,

Thanks for sharing an alternative for cyclic group, it was very useful.

Regards,

Saniya Shaikh.

brunobertels
Valued Contributor

Re: Can we change the dimension of a bar chart with a parameter in qlik sense?

you're welcome

bellamae
Valued Contributor

Re: Can we change the dimension of a bar chart with a parameter in qlik sense?

This is how I have done it before

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: Can we change the dimension of a bar chart with a parameter in qlik sense?

Hi,

From version 2.2.4 cycles are embedded within Sense, without using extensions. Just add 'Alternative dimensions' as shown below the dimension you already use in a visualization. From the menu of each visualization, the end-users can choose between the dimension and alternative dimension. This way you can create very powerful combinations by using drill-down master items and 'cycles'/alternative dimensions. Have a look at What's New in Qlik Sense 2.2 - Presentation - YouTube.