Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Partner
Partner

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
MVP & Luminary
MVP & Luminary

Re: Background Color from Dimension

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

5 Replies
MVP & Luminary
MVP & Luminary

Re: Background Color from Dimension

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

Re: Background Color from Dimension

MVP
MVP

Re: Background Color from Dimension

Could you post your sample qvw that demonstrates the issue?

engishfaque
Valued Contributor III

Re: Background Color from Dimension

Dear Robin,

Please try,

=$(SentScaleCol)

Kind regards,

Ishfaque Ahmed

Partner
Partner

Re: Background Color from Dimension

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)'

];