Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
LE2
Contributor
Contributor

Use variable condition as dimension

I created a variable called "Field" and I tried to use this variable to control my chart dimension. Here is my dimension expression:

=IF(Field='industry',industry,
      IF(Field = 'country',country,
           IF(Field='purpose',purpose)))

The bar chart: X-axis is date, Y-axis is balance value, bars are coloured by this expression dimension.

I used a drop down "Variable Input" bundle to select dynamic values of "Field", to choose which dimension to use for colouring.

However, with different selections in the "Variable Input" bundle, the chart does not change at all.

Plz help me with this. Thanks.

Qlik Sense Business 

Labels (3)
2 Replies
Lisa_Sun
Support
Support

This can be achieved by setting color condition.

 

Capture.png

Capture1.PNG

Example: if(Product='$(colorbar)',RGB(141,170,203),RGB(255,0,0))

 

Help users find answers! Don't forget to mark a solution that worked for you! If already marked, give it a thumbs up!
LE2
Contributor
Contributor
Author

I don't think this is a solution. I want my charts look like this:

截屏2022-02-18 17.37.29.png

And in each bar, the dimension chosen by the IF expression is used for coloring.

.