Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
richard_gale
Contributor II
Contributor II

Chart Show condition

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

Labels (6)
1 Solution

Accepted Solutions
Chanty4u
MVP
MVP

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

View solution in original post

2 Replies
Chanty4u
MVP
MVP

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

richard_gale
Contributor II
Contributor II
Author

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