Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Maintain RGB colors (with use of variable)

I've made an overview of colors to use on my dimensions:

=if(='1',RGB(0,0,0),

if(='2',RGB(255,0,0),

if(='3l',RGB(200,164,31))))

When I apply this colormapping in 'Expressions - Backgroundcolor' everything goes well. But when created a variable that contains the above expression and saved as '=$(vColor)'., when I use the variable '=$(vColor)' in 'Expressions - Backgroundcolor' it does't seem to work.

1 Solution

Accepted Solutions
maxgro
MVP
MVP

try to define the variable without =  (see image)

if([Indicatif]='AAAA',RGB(0,0,0),

if([Indicatif]='BBBB',RGB(255,0,0),

if([Indicatif]='GGGG',RGB(200,164,31))))

background expression

$(vColor)

1.png

View solution in original post

6 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Use

=vColor without $ ....

Let me know

rustyfishbones
Master II
Master II

Use $(vColor)

maxgro
MVP
MVP

try to define the variable without =  (see image)

if([Indicatif]='AAAA',RGB(0,0,0),

if([Indicatif]='BBBB',RGB(255,0,0),

if([Indicatif]='GGGG',RGB(200,164,31))))

background expression

$(vColor)

1.png

Not applicable
Author

Thanks Massimo. Now when I adjust the rgb code in the variable, the colors change automatically (which until now had not yet succeeded).

its_anandrjs

Write a variable like

Let vColor =if(='1',RGB(0,0,0), if(='2',RGB(255,0,0), if(='3l',RGB(200,164,31))))

And in the Background use it like =$(vColor) or you can use vColor

maxgro
MVP
MVP

Please close this discussion by giving Correct and Helpful answers to the posts which are useful for you.  It helps others in finding answers for similar scenarios.