Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
EugeniaCastilla
Contributor
Contributor

How to dynamically add/remove measures in a Line Chart Qlik Sense

Hello! 

I have a requirement to create a line chart. The line chart will have 3 measures, A, B and C.

From a filter, if the user selects values A and B, then the measures A and B should appear. If the user selects A and C, measures A and C should appear.

If the user selects all three values, the 3 measures should appear and so on. 

 

I am familiar with the use of inlines, and the use of the GetSelectedValue() and varaibles. What I am struggling with is the fact that the line chart doesnt have a Conditional functionality applied to each measure, so I don't know how to hide/display a measure. 

Can someone please help! 

Labels (3)
2 Replies
Mark_Little
Luminary
Luminary

Hi @EugeniaCastilla 

It is not ideal, but the way i have done it is with multiple charts in a container and then using the method you discussed above to change the tab depending on selection

 

EugeniaCastilla
Contributor
Contributor
Author

that would entail creating as many charts as options... and the options right now are only 3 but the escalation is a big possibility. I have seen that using this formula as a measure 

if($(aux)=1,sum(sales)) doesnt show a line when the value of the variable is set to 0 because obviously, returns null. 

The only issue with this approach is that the legend still shows the label but I think I can use the same formula somehow to hide/hsow the name. 

 

Whta do you think? I know it is not ideal but it is the best solution yet, I think.