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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
cdunham
Contributor
Contributor

Conditional Color for Stacked Bar Expression

This is my first post and I am very new to QlikView so let me know if I need to add anything else.  I have a combo chart with some stacked bars.  I need one of the expressions to change color if it is greater or lower than 0.  The expression is 

Sum({$<Revenue.Source={'Forecast'},[Date]={">$(vMaxBookedDate)"}>}Revenue.Price)-Sum({$<Revenue.Source={'SABA', 'SABA Valencia','SpecialContracts'},[Date]={">$(vMaxBookedDate)"}>}Revenue.Price)

I have tried 

if((Sum({$<Revenue.Source={'Forecast'},[Date]={">$(vMaxBookedDate)"}>}Revenue.Price)-Sum({$<Revenue.Source={'SABA', 'SABA Valencia','SpecialContracts'},[Date]={">$(vMaxBookedDate)"}>}Revenue.Price))>0,RGB(180,23,30),RGB(0,0,0)) 

This did not work.  Any recommendations would be appreciated. 

3 Replies
edwin
Master II
Master II

that should work.  of course you added it in the background of the expression - rt?  otherwise, pls attach a QVW.

cdunham
Contributor
Contributor
Author

I was trying to put it into the color itself on the colors tab.  Putting it into the expressions background color made it work.  Thank you!

edwin
Master II
Master II

youre welcome