Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
tmumaw
Specialist II
Specialist II

Setting Colors in Text Box

Hi all,

I'm trying to set some colors based on a value in a text box.  Does anyone see anything wrong with this statement?  Colors not working.  Thanks

=Num(if(Sum({<FISYR = {$(=$(vFisYr) - 0)},YTDFlag = {1}>} [Inv Gross]) - Num(Sum({<FISYR = {$(=$(vFisYr) - 1)},YTDFlag = {1}>} [Inv Gross]) < 0),RGB(255,0,0),RGB(0,102,0)))

1 Solution

Accepted Solutions
sunny_talwar

But this is a color expression, isn't it?

=If((Sum({<FISYR = {$(=$(vFisYr) - 0)}, YTDFlag = {1}>} [Inv Gross]) - Sum({<FISYR = {$(=$(vFisYr) - 1)}, YTDFlag = {1}>} [Inv Gross])) < 0),RGB(255,0,0),RGB(0,102,0),'$###,###,##0')

There are two different location... one is the general tab where you have your expression and then you have font tab where you use color expression. What is confusing me is that why do you need to format the expression which goes on the font tab?

View solution in original post

10 Replies
sunny_talwar

Try this

=If((Sum({<FISYR = {$(=$(vFisYr) - 0)}, YTDFlag = {1}>} [Inv Gross]) - Sum({<FISYR = {$(=$(vFisYr) - 1)}, YTDFlag = {1}>} [Inv Gross])) < 0),
RGB(255,0,0),
RGB(0,102,0)
)
tmumaw
Specialist II
Specialist II
Author

Nope

sunny_talwar

You are using this for coloring the text box object?
tmumaw
Specialist II
Specialist II
Author

=If((Sum({<FISYR = {$(=$(vFisYr) - 0)}, YTDFlag = {1}>} [Inv Gross]) - Sum({<FISYR = {$(=$(vFisYr) - 1)}, YTDFlag = {1}>} [Inv Gross])) < 0),RGB(255,0,0),RGB(0,102,0),'$###,###,##0')

 

It does not like RGB on.....

tmumaw
Specialist II
Specialist II
Author

I am using it in a text box to show either a positive or negative variance.  If the calculation returns 0 or less it's red otherwise green.

sunny_talwar

I am not sure I understand the use of ,'$###,###,##0') at the end? Are you looking to format color? I don't think that is possible :).... but may be I am missing something here?
tmumaw
Specialist II
Specialist II
Author

I'm using it to format the value in the text box....

 

sunny_talwar

But this is a color expression, isn't it?

=If((Sum({<FISYR = {$(=$(vFisYr) - 0)}, YTDFlag = {1}>} [Inv Gross]) - Sum({<FISYR = {$(=$(vFisYr) - 1)}, YTDFlag = {1}>} [Inv Gross])) < 0),RGB(255,0,0),RGB(0,102,0),'$###,###,##0')

There are two different location... one is the general tab where you have your expression and then you have font tab where you use color expression. What is confusing me is that why do you need to format the expression which goes on the font tab?

swapniltaz
Contributor III
Contributor III

Can you Try this 

 

=Num(if(Sum({<FISYR = {$($(=vFisYr) - 0)},YTDFlag = {1}>} [Inv Gross]) - Num(Sum({<FISYR = {$($(=vFisYr) - 1)},YTDFlag = {1}>} [Inv Gross]) < 0),RGB(255,0,0),RGB(0,102,0)))

 

I have changed the Postion of equal to(=) in Double dollar sign expansion