Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Colour by Dimension using variable not working

Hi,

I am having trouble with the new colour by dimension feature when trying to use a variable to define the colouring dimension.

It seems that any attempt to use an expression to determine the dimension by which colouring should occur results all bars being coloured grey. I have tried defining a measure in the master items but I can only ever get the 'null values' colour to be selected.


Screenshots that explain the issue are attached below.

Using colour by expression could be an alternative, but losing the legend makes the chart difficult to read.

Any suggestions would be appreciated. Thanks!

Without using a variable.

No variable.JPG

Using a variable:

WithVariable.JPG

Variable.JPG

3 Replies
michellisf
Contributor
Contributor

same problem 😕

 

Harrisonpeg7
Contributor II
Contributor II

Hello, hope you are doing well!

I do not have an intuitive fix to your issues but I can offer a potential workaround. 

Click on "color by expression"(fx) and try something like what is below but fill in your own field and id name 

if(Employment Type='Supplier', Lightblue(),if(Employment Type='Part Time',Cyan(), if(Employment Type='Casual',DarkGray(),if(Employment Type='Full time',yellow(),if(Employment Type='etc",lightred())))))

not sure if this will provide the required results but I use it to color similar bar graphs/segments...Also you may have to delete some parenthesis at the end depending on how many variable you are defining.

 

Hope this helps! Harrison

adamhutch
Contributor
Contributor

I was having the same issue and I put the variable's expression, rather than the variable, as the color dimension and it works.