Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

kevindfalk
New Contributor

Bar Chart: Show different reference line according to selected dimension

Hello everyone,

is it possible to change the value of a reference line in a bar chart according to the selected dimension?

I was looking for something like a formular for the reference line, i.e.

if(selectedDimension = Category, 2000, if(selectedDimension = Country, 4000, 0)

Right now, I have naively "solved" this with two reference lines, but obviously this is a bad solution.

QlikSense.PNG

Any ideas for a solution would be nice.

Thank you

1 Solution

Accepted Solutions
mikaelsc
Contributor III

Re: Bar Chart: Show different reference line according to selected dimension

indeed missing function to work with alternative dimensions/measures.

may i suggest use the "qs variable" extension:

create a variable containing your dimension name, and use that variable as dimension and as parameter in your reference line

vDimension = 'CategoryName' or 'Country' (toggle with a button in the extension)

ref line : if($(vDimension)='Country',..., ... )

1 Reply
mikaelsc
Contributor III

Re: Bar Chart: Show different reference line according to selected dimension

indeed missing function to work with alternative dimensions/measures.

may i suggest use the "qs variable" extension:

create a variable containing your dimension name, and use that variable as dimension and as parameter in your reference line

vDimension = 'CategoryName' or 'Country' (toggle with a button in the extension)

ref line : if($(vDimension)='Country',..., ... )

Community Browser