Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi - I'm trying to create a Dimension reference line in one of my line charts that only appears when a particular selection is applied. I can hard code the 'Show condition' expression for the field selection, Field='x', but I need the condition to be variable.
I thought I would be able to use the GetFieldSelections function in the Show condition expression but, although I can see this Function provides the correct answer, the Show condition expression doesn't recognise it.
Any help to point this newbie in the right direction much appreciated!
Thanks, Richard
Create a variable by going to the Variables overview page and clicking "Add new variable".
Name the variable something meaningful, such as "Show Ref Line".
In the "Initial value" field, enter the condition you want to use. For example, Field='x'.
In the line chart, go to the "Reference lines" tab in the properties panel.
Click "Add" to create a new reference line.
In the "Expression" field, enter the expression you want to use for the reference line.
In the "Show condition" field, enter "$(Show Ref Line)".
Note that the "$( )" syntax is used to reference a variable in Qlik Sense
Create a variable by going to the Variables overview page and clicking "Add new variable".
Name the variable something meaningful, such as "Show Ref Line".
In the "Initial value" field, enter the condition you want to use. For example, Field='x'.
In the line chart, go to the "Reference lines" tab in the properties panel.
Click "Add" to create a new reference line.
In the "Expression" field, enter the expression you want to use for the reference line.
In the "Show condition" field, enter "$(Show Ref Line)".
Note that the "$( )" syntax is used to reference a variable in Qlik Sense
Thank you, Chanty4u!
I had also been trying to use a variable but think I was just forgetting the $() syntax so it was referenced properly. I also had to include the Field= in the Show Condition expression, so the whole expression becomes =Field='$(variable)'
Thanks again, Richard