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

Qlikview: barchart color based on category (If Then)

Hi,

My name is Jesse and I am new to Qlikview.

In this app there is barchart with different colors. Now I want to match the color of the barchart with the description. I have searched for a solution here, but could only find 'based on value'.

Here is a screen of the barchart and the 1st color I tried to change to the description: Black.

Hope you can help me out.

BR,

Jesse

Labels (1)
2 Solutions

Accepted Solutions
jmartineze
Partner - Creator
Partner - Creator

hello Jesse, try to change the color in the Expressions tabs, background color. The option background color is hidden, press + in your expression and you can see it.

View solution in original post

jmartineze
Partner - Creator
Partner - Creator

Sure that your table with [KLEUR BESCHRIJVING] and R, G, B fields are correct. if you have more than one row for the same [KLEUR BESCHRIJVING] value the default color is black.

View solution in original post

9 Replies
jhupkens
Contributor
Contributor
Author

I forget to mention that there is a long list of colors. If it would be easier to just upload a table and use variables instead, can you show me how?

Jesse

jmartineze
Partner - Creator
Partner - Creator

hello Jesse, try to change the color in the Expressions tabs, background color. The option background color is hidden, press + in your expression and you can see it.

jhupkens
Contributor
Contributor
Author

Hi,

That was easy 🙂 thanks a lot!

I can use multiple nested If statements, I know that.

But since I have a number of color descriptions, is there a way to just upload a table into the script and use variables instead?

Jesse

jmartineze
Partner - Creator
Partner - Creator

You can load a table with Field and three fields numbers values.

 

COLORS:

load 

FieldName, R, G, B;

 

where R, G, B are  values to use with de rgb() function in the background option.

With this table only you nedd the background expression like this    =rgb(R,G,B)

 

J.

jhupkens
Contributor
Contributor
Author

Great! How does the expression of the background color looks like?

this doesnt work:

if([KLEUR BESCHRIJVING]=Name,RGB(R,G,B))

Jesse

jmartineze
Partner - Creator
Partner - Creator

only  rgb(R,G,B)

jhupkens
Contributor
Contributor
Author

I tried that, but then all the bars are the same color (black).

Jesse

jmartineze
Partner - Creator
Partner - Creator

Sure that your table with [KLEUR BESCHRIJVING] and R, G, B fields are correct. if you have more than one row for the same [KLEUR BESCHRIJVING] value the default color is black.

jhupkens
Contributor
Contributor
Author

That was the issue, indeed. There are 2 colors black so 2 with the same RGB. Adusted and works.

Thanks again! 

Jesse