Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
robinrouleur
Partner - Creator
Partner - Creator

Background Color from Dimension

Hi

I am trying to set the background color of a chart expression using a dimension containing an RGB(x,y,z) string but it is not working.  A screenshot is attached. Can anyone help?  Note that the original chart was a bar chart but I'm showing a table chart equivalent to give visibility of the dimension values.

I believe that I am following Henric's instructions in the post below (step 4 in particular) but maybe I'm missing something?

Qlik Design Blog : Colors in charts | Qlik Community

Robin

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It looks like your SentScalCol field may just be a string "RGB(...)". Did you evaluate the function when you loaded it to create a proper dual color value? If you have your colors stored as string expressions, a simple way to make them proper color duals is to use the evaluate() function at load time.

evaluate(SentScalCol) as SentScalCol

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

View solution in original post

5 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It looks like your SentScalCol field may just be a string "RGB(...)". Did you evaluate the function when you loaded it to create a proper dual color value? If you have your colors stored as string expressions, a simple way to make them proper color duals is to use the evaluate() function at load time.

evaluate(SentScalCol) as SentScalCol

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

Not applicable

tresesco
MVP
MVP

Could you post your sample qvw that demonstrates the issue?

engishfaque
Specialist III
Specialist III

Dear Robin,

Please try,

=$(SentScaleCol)

Kind regards,

Ishfaque Ahmed

robinrouleur
Partner - Creator
Partner - Creator
Author

Thanks Rob.  I thought it was an evaluation issue but couldn't work out how to get it to execute the RGB command string, mainly because I was focussing on doing it at the chart level.  Evaluate() during Load did the trick!  Here's my Load statement for future reference (the color variables contain RGB() strings:

SentimentScale:

LOAD

  PhraseSentiment, PhraseSentiText,

  Evaluate(SentScaleCol) AS SentScaleCol

INLINE [

  PhraseSentiment,PhraseSentiText,SentScaleCol

   2, Very Positive, '$(vDarkGreen)'

   1, Positive, '$(vLightGreen)'

   0, Neutral, '$(vLightBlue)'

  -1, Negative, '$(vOrange)'

  -2, Very Negative, '$(vDarkRed)'

];