Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How can you set a minimum color (expression) in a bar chart on Qlik Sense Desktop?

Hello all,

I'm currently working on a food item visualization within Qlik Sense Desktop and I had a question about color coding and string functions. I would like to color every category that costs more than 20M blue. I would like to make everything less than 20M pink. How is this possible in Qlik Sense Desktop using the functions available? I'm attaching a picture of what I have so far (the grey chart). Any help is greatly appreciated and I thank you all for your time!

Sincerely,

Debashish

7 Replies
brunobertels
Master
Master

Hi

in the control panel of your bar chart

in color and legend choose custom color by expression

then

add this :

if(

mymesure < 20 000 000 , rgb(255,82,255),rgb(51,155,255)

)

"mymesure" is the mesure you use in your bar chart

hope it helps

Not applicable
Author

Hi Debashish, the expression from Bruno is correct. You can also go to "Appearance" -> "Colors and Legend" and then Change "Range" from "Auto" to "Custom" and you can add a "Min" and "Max".

Anonymous
Not applicable
Author

Thanks, I'm trying it out right now but I'm still getting an error in my expression as shown here. All your help is appreciated and thanks again!

error.PNG

brunobertels
Master
Master

Hi

Type 20 000 000 rather than 20,000,000

Comma are used as separators in qlik expression

Anonymous
Not applicable
Author

I just tried that and I'm still getting an error. Thanks for the continued help.

stillerror.PNG

haraldstrass
Partner - Contributor
Partner - Contributor

Hi Debashish,

no spaces are allowed within the number, so type 20000000 instead of 20 000 000.

hope it helps - for me it did

Harald

brunobertels
Master
Master

Hi

Sorry Harald is right : no space within the number, 20000000 is the good answer

Bruno