Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

ysiroong
New Contributor III

Scaled Conditional Coloring

Is it possible to add conditional coloring to a column that's not based on set values?

Instead of setting the background color to green when value is greater than x, I want to have a range of colors that will scale with the data set.

So let's say I have a table with 3 rows and 1 revenue column.  I want to color the max revenue column green, the mid revenue yellow, and the least revenue red, regardless of what the amount is.

Is this possible?

1 Solution

Accepted Solutions
effinty2112
Honored Contributor

Re: Scaled Conditional Coloring

Hi Robert,

                    You can write a Pick expression with 15 or more choices of colour and you can use it any of your charts. Such an expression would work equally well if you have three dimensional values or fifteen.

You could experiment with the ColorMix wizard too.

Kind regards

Andrew

6 Replies

Re: Scaled Conditional Coloring

Yes, that's possible. Click on the + in front of the expression on the Expressions tab. Select Background Color and enter an expression that calculates the color in the Definition input field. You can add all your conditions and the matching colors in that expression.


talk is cheap, supply exceeds demand
jpenuliar
Valued Contributor III

Re: Scaled Conditional Coloring

Hi Robert,

Assuming you already are familiar with the functions Min.Median & Max in qlikview,

You can use them in Expression Background Color property to apply colors.

effinty2112
Honored Contributor

Re: Scaled Conditional Coloring

Hi Robert,

                    We have a lot of flexibility in how we can colour cells by setting the background colour using a formula.

Colour.bmp

For your example I would try something like

Pick(Rank(sum(Revenue)),Green(),Yellow(),Red())

Kind regards

Andrew

ysiroong
New Contributor III

Re: Scaled Conditional Coloring

Thanks!  This looks like it would be closest to what I'm looking for.  Is it possible to generate the color ranges dynamically?  The data set I'm working with isn't just confined to 3 records.  The table I'm working on is 5 regions and each region has a different number of areas.  So one region may need 10 different color ranges while another might need 15.

effinty2112
Honored Contributor

Re: Scaled Conditional Coloring

Hi Robert,

                    You can write a Pick expression with 15 or more choices of colour and you can use it any of your charts. Such an expression would work equally well if you have three dimensional values or fifteen.

You could experiment with the ColorMix wizard too.

Kind regards

Andrew

ysiroong
New Contributor III

Re: Scaled Conditional Coloring

I think the ColorMix Wizard is exactly what I'm looking for.

Thanks Andrew!

Community Browser