Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
danialier
Creator III
Creator III

Negative numbers in red / positive numbers in green in a text box


Hello,

I have a formula in a text box that is giving the performance of an specific busiuness unit. Which formula should I put in the Color Area Calculated field to make the positive numbers in green and the negative in red ?

Thanks !

dani

1 Solution

Accepted Solutions
sundarakumar
Specialist II
Specialist II

in your case the formula would be

if(expression >0,green(),red())

would do in the calculated field, in the color area(font tab)

-Sundar

View solution in original post

4 Replies
sundarakumar
Specialist II
Specialist II

You should add the expression like

if(expression>threshold,red(),green())

in the below shown place.

post.PNG.png

in the font tab, color area.

sundarakumar
Specialist II
Specialist II

in your case the formula would be

if(expression >0,green(),red())

would do in the calculated field, in the color area(font tab)

-Sundar

danialier
Creator III
Creator III
Author

Excellent thanks Kalaimani

Not applicable

I use this method in my dashboard but it means that the entire expression has to be copied into the Font Color formula.  The issues I have with this are:

1) Doesn't this affect performance because the formula has to be calculated twice? Once for the expression to be displayed in the text box and once for the text color?

2) Is there a way of referring to other calculations in other text boxes like you can in a Table Box.  I have found that changes have been made to the expression that displays but those changes were not put into the color formula also.  It would be nice if there was a "Current Expression Value" function or the ability to refer to another object like you can with a column.  ie. if [Budget] - [Sales] >0, green, red.  That way any changes in the Budget calulation would then be seen by the font color expression.  Any ideas?