Qlik Community

Qlik Design Blog

All about product and Qlik solutions: scripting, data modeling, visual design, extensions, best practices, etc.

Employee
Employee

Dimension Colors

A few months ago, I wrote a blog about setting colors in master dimensions and measures.  Today I am going to share a little more about how master dimensions can be set to a single color or multiple colors.  Let’s first talk about setting a dimension to a single color.  This can be helpful when you want to use a color other than the Qlik Sense default color in your charts.  For instance, a bar chart may look like this with the default blue color.

default blue.png

But if your app is using a different color theme, you may want all the bars to be purple for instance.  You can do this by setting the Dimension color on the Edit dimension tab of the master dimension to the color you would like the dimension to be.  This color will be the same for all dimension values which is good practice when there are many dimension values.

edit dimension small.pngpurple small.png

Now let's discuss setting a master dimension to multiple colors.  Sometimes you may need the color for each dimension value to be different.  This is when you can use the Value colors tab of the master dimension to set the colors of each dimension value.  The stacked bar chart below is a good example of when you may want the dimension values to have different colors.  This chart is looking at the calls by activity type and call type.  The call type dimension values are set to 3 different shades of blue so that they can be distinguished in the stacked bar chart.  If the color values were not set, then the standard blue, red and yellow colors would be used instead.

stacked small.png

The color values can be set on the Value colors tab of the master dimension (see image below).  A color scheme can be used to set the colors or each value can be set manually.  The call type field only has 3 values so it is a good candidate for value colors.  You want to avoid using values colors or coloring by dimension if there are several different dimension values.  Too many different colors (or not so different colors) can become confusing and indistinguishable to the user.

value colors.png

On the Value colors tab, there is also the option to select a color for Others, if you are adding any limitations to the dimension, or for Null values.  When using the value colors to color your dimensions, be sure to select color by dimension and enable library color in the properties of the chart.  Check out this video in Qlik Sense Help for more information.

These color features available in dimension master items provide one place to set and edit the dimension colors used in charts.  You can set it once and use it in multiple charts.  This promotes consistency in our apps thus making them easier to digest and understand.

Thanks,

Jennell

7 Comments
robert99
Valued Contributor II

Hi Jennell

This is a great feature

BUT its doesn't work with ALTERNATIVES. So its either don't use alternatives. Or don't use this feature. And it would be so easy to fix. I always color by the chart dimensions (I have never colored by another dimension). So just have an option to color by the first or second chart dimension.

0 Likes
55 Views
Employee
Employee

Hi Robert,

Thanks for feedback. If you check the November beta you can see that we've added that exact setting to our charts. As a developer you can pick which relative dimension to color by.

Color Dimension.PNG

Best regards,

Patrik.

55 Views
anderseriksson
Contributor III

A small step further towards freedom to color our charts the way we want without having to put all dimensions and expressions as master items if I understand correctly.
But when will we be free to color by expression value without having to retort to master items?
Fairly common having a graph with a couple lines or bars and customer requirement is to use the corporate colors.
Aka revenue should be this color and budget that color.
Different visualizations might require tweaking of the expressions and then we end up with tons of master expressions for the revenue because graphs require different set analysis to work.
Might end up with multitude of revenue master expressions where the majority is only used in one single graph because of some special requirement in that expression.

0 Likes
55 Views
paulyeo11
Valued Contributor II

I prefer to make use of master items to organise my dimension and expression. and it is better way to control the color of the chart. well done to Qlik support team.

0 Likes
55 Views
anderseriksson
Contributor III

With a limited number of expressions it makes sense (sorry no pun intended).
But with many expression variations, could be different set analysis for different charts, master items become unmanageable if every expression needs to be a master item in order to control the color.
I'd prefer to have both possibilities, color it as a master item but also setting individual color directly in a visualization expression.
One possibility does not exclude the other possibility.

0 Likes
55 Views
chandnishah
New Contributor

Hi Robert,

I know this is quite an old thread but just wanted to know how you fix this in case of alternative dimensions?

0 Likes
55 Views
robert99
Valued Contributor II

Hi Chandni

I use dimension 1 (or 2 etc) rather than an actual dimension as noted by Patrik in this thread.

It works with alternative. But unfortunately it doesn't work with drill down. In other words its not possible to set up a drill down using master dimensions. Only the actual dimension

I hope this helps

0 Likes
55 Views