Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

conditionally view an expression in a chart

i have a chart which has three expressions. i would like to know how to conditionally view one of the three expressions on the chart when a button is selected

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can group the three expressions in the Expression tab of the properties screen. You can then select in the chart which expression should be shown. That way you don't need a button. If you want to use buttons instead you can use a variable (e.g. v_ShowExp). Add actions to the buttons to set the value of the variable (e.g set variable v_ShowExp to value 'Exp1'). The conditional display expression of the chart expression can use the variable to determine if the expression should be shown or not (e.g. for the first expression if($(v_ShowExp)='Exp1',1,0).


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can group the three expressions in the Expression tab of the properties screen. You can then select in the chart which expression should be shown. That way you don't need a button. If you want to use buttons instead you can use a variable (e.g. v_ShowExp). Add actions to the buttons to set the value of the variable (e.g set variable v_ShowExp to value 'Exp1'). The conditional display expression of the chart expression can use the variable to determine if the expression should be shown or not (e.g. for the first expression if($(v_ShowExp)='Exp1',1,0).


talk is cheap, supply exceeds demand
Not applicable
Author

im new to qlikview so i need few more details

can u tell me to create a variable and assign it to a button

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Open the Variable screen via the menu Settings->Variable Overview (or CTRL+ALT+V) and add the variable

qv_add_variable.png

Add a button and on the Actions tab add an action to the button. Choose External, Set Variable

qv_add_button_action_1.png

Set the variable to the new variable you created and set the value to a string

qv_add_button_action_2.png

Set the expression for the conditional display to if($(v_ShowExp)='Exp1',1,0). This checks if the value of the variable is 'Exp1'. If it is return 1 (meaning True) to show the expression, otherwise return 0 (meaning False) and hide the expression

qv_add_conditional_to_expression.png


talk is cheap, supply exceeds demand