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: 
chaorenzhu
Creator II
Creator II

Is it possible to ignore one dimension in bar chart based on condition

Hi experts,

My case is that now I have a bar chart with two dimensions (let's call them dimensionA and dimensionB) and one measure. I'm creating a variable (let's call it vCustom) and adding multiple values from Variable Input so that user can select a value from a dropdown list (say now the dropdown list has two values, 'A' and 'B'). Now for some cases (such as vCustom='A') I want both dimension A and dimensionB to be used in the chart, whereas for some cases (such as vCustom='B') I want only dimensionA to be used. Can you advise how I can achieve it?

So far I have tried creating a dummy field (let's call it dimensionC) in my load script, with fixed value across all records, and I use

if(vCustom='A',dimensionB,if(vCustom='B',dimensionC))

as a dimension together with dimensionA. However, it seems that no matter what I select in the dropdown list, only dimensionC is used and dimensionB is totally ignored even though I select 'A' for vCustom. 

Anyone can provide insights why is this the case? Thank you.

Labels (2)
2 Replies
JHuis
Creator III
Creator III

Dear 

You could add both dimensions and use conditonal show.

So dimensionA conditonal show: $(vCustom)='A' or 'B'

So dimensionB conditonal show $(vCustom)='A'.

 

hope this helps?

JHuis_0-1650974919713.png

 

chaorenzhu
Creator II
Creator II
Author

Hi thanks for the reply. May I know where is the conditional show? In my Qlik Sense for a dimension, there are only field, label and limitation, but I didn't see any conditional show. May I know which version you're using?

Thanks