Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set background color based on value

Hi all,

I'm trying to set the background color for an expression based on a field value.

For my example table with just one row everything works fine, if there is a second row the background colour isn't set any more.

Ex.:

Fieldvalue T1_RGB:                        RGB(254,232,200)

Expression for background color:     =$(=only(T1_RGB))

Anyone an idea?

Regards

Thomas

5 Replies
er_mohit
Master II
Master II

are you want to change the colour of field value..?if this

then add expresion in text colour.
might be helpful you

Not applicable
Author

Hi,

No, i don't want to change the text color, but the color of the background.

But I think the problem is the same also for the text color.

Gysbert_Wassenaar

Trying to evaluate field values as expressions like you're trying is a pita. Try adding just the r,g,b values to your table instead of the expression and simply use rgb(r,g,b) as expression for the background color.

[T2_COLOR]:

LOAD * Inline [

    T2_RGB,r,g,b

    "RGB(254,232,200)",254,232,200   

    "RGB(253,187,132)",253,187,132       

];


talk is cheap, supply exceeds demand
Not applicable
Author

Separate r,g,b values are working fine. Thanks.

But why isn't it a good idea to put either "RGB(254,232,200)" or "(254,232,200)" as value in a table and use it indirect? Would it be at least possible to evaluate an expressin indirect, or isn't it working at all?

Not applicable
Author

Hi,

You can store the information as a color.

You can also use some aggregation functions (when it makes sense).

Please see attached

Hope it helps

Regards