Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Our May 2021 end-to-end product release from Data Integration to Data Analytics is out! READ DETAILS
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

Color by Dimension in alphabet

Hi Guys,

I have been working on Feb 2019 version and used color by dimension in my charts but it looks like assigning the colors based on values instead of alphabetical order. 

For Example: I have a level field with L1, L2 and L3 as values. The library colors are not assigned in alphabetical order. The first color in the library is assigned to L3, the second color in the library is assigned to L1  and the third color in the library colors is assigned to L2. 

For this I don't want to create a master dim and force the colors because we might change the theme in future.

Is there a way I can achieve this without forcing the colors.




3 Replies

The colors will be assigned in the order they are sorted in the chart. If you select Persistent colors, they will be assigned colors in load order. If you want to control this alphabetically, you can load the field in alphabetical order in it's own table and drop that table at the end so that the colors are stored internally in alphabetical order.
Contributor III
Contributor III

I have a stacked bar chart with BU as  a primary dimension and the level in stacked. The level is sorted in asc but the colors were not assigned as expected. I was not able to un-check  the Persistent colors option also its grayed out.

I have a pie chart also by level as dim where it assigned the colors in chart sort order but I don't know how could I do that in stacked bar chart.

I also tried loading Level field in its own table using order by and dropped it at the end but it still didn't work.

So I tried this.

load level,

        level as Level_Color

Resident table order by Level;

I used Level_Color in color by dimension. It was working fine but this is not how I want to do it. Is there any alternative to achieve this??


Contributor III
Contributor III

Did anyone get a chance to look at it. The way I did was working fine but only the problem is Pie chart with alternative dimensions in it. When the active dim is level I want to color the pie by Level_Color dim I created in above script and when the active dim changed to other alternative dim like region I want to use region in the color by dimension.

I tried GetObjectField(0) & GetObjectDimension(0) also but it didn't work..

How I could I achieve this??