Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Applying RGB to a value in Text Object

Dear All,

Scenario:

A text object contains a value. If value is greater than Zero(0) the value should be in green otherwise in red.

EX: if(value>0,'value in Green Color','Value in Reg Color')

Thanks in Advance

1 Solution

Accepted Solutions
rubenmarin1

Hi Praful, in Font tab-->click on the "color", select 'Calculated' and set the expression, something like:

If(value>0, Green(), Red()) --> You can especify a RGB color like this:

If(value>0, RGB(0,255,0), RGB(255,0,0))

Change 'value' for the expression you use in the text object, in example, if value is =Sum(Sales), the color expression should be:

If(Sum(Sales)>0, Green(), Red())

View solution in original post

5 Replies
robert_mika
Master III
Master III

maybe:

=if(Value>0,Green(),Red())

Go to Background-Color-Calcualted and put your expression there:

Let say:

=if(max(Amount)>0,Green(),Red())

datanibbler
Champion
Champion

Hi Praful,

you can use the RGB() function to specify colours. You can expand any of the expressions in your chart and specify some options, among them the background_colour. There you will have to enter it in $()

=> That would be >>  $(RGB(0,0,0))  <<<

To keep the colouring consistent between your apps, you could define a colour_palette in a qvs and use that instead of individually specifying the colours every time.

HTH

Best regards,

DataNibbler

rubenmarin1

Hi Praful, in Font tab-->click on the "color", select 'Calculated' and set the expression, something like:

If(value>0, Green(), Red()) --> You can especify a RGB color like this:

If(value>0, RGB(0,255,0), RGB(255,0,0))

Change 'value' for the expression you use in the text object, in example, if value is =Sum(Sales), the color expression should be:

If(Sum(Sales)>0, Green(), Red())

Not applicable
Author

Hai Robert,

Thanks for the reply.

But my need is to make a value in text object either in red or green color according to the condition

Thanks

Not applicable
Author

Thank you Ruben