Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculated Colours in Bar Charts

I have a stacked bar chart. This shows proportions against three values, 'Yes', 'No' or 'N/A' (field "Satisfaction"). These are also represented by -1, 0 and 1 (field "Satisfied").

To make sure, especially when drilling down, that colours are Green, Red and Yellow respectively, I am trying to use the Color Area Base Color Calculated feature from the Colors tab. Neither of my formulae work:

=if(Satisfied=-1,rgb(0,255,0),if(Satisfied=0,rgb(255,0,0),rgb(255,255,0)))
=if(Satisfaction='Yes',rgb(0,255,0),if(Satisfaction='No',rgb(255,0,0),rgb(255,255,0)))

When I apply either of these formulae to the background colour of the cells of a straight table object, they both work just fine.

Is this a bug in Version 9, or just my formulae?

It would appear that whatever variables I am using for my colour formulae, they are null. Is there a way to perpetuate a value in a chart without it appearing in the chart? Seems to make the calculated colour pretty redundant if not.

2 Replies
Not applicable
Author

alternative calculation that doesn't work:

=if(isnull(Satisfaction),rgb(255,255,0),if(Satisfaction='Yes',rgb(0,255,0),if(Satisfaction='No',rgb(255,0,0))))


renders as rgb(255,255,0)

Not applicable
Author

Further testing suggests that the formulae work when the entire bar is a single value, although the formulae don't work on an unstacked bar.