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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
gfisch13
Creator II
Creator II

Change the color of a Bar based on an expression

Hi Everyone, I'm traying to change the color of a bar in a bar chart to RED Based on this expression but I keep getting the 'error in expression' message.   Can anyone tell me what I'm doing wrong? 

Thanks! 

George

= (Sum (AMOUNT_AT_RISK_USD) - Sum (AMOUNT_PREVENTED_USD) - Sum (AMOUNT_RECOVERED_USD))>0, RED())

21 Replies
gfisch13
Creator II
Creator II
Author

Sunny - this is a continuation of the issue above.  I think I'm missing something.......... in the screen print below you can see that I've got the colors working the way I want them..........the problem now is the presentation.  Everything is grouped on the Country, How do I get separate bars for the Amount at Risk, Prevented/Recovered and Total Loss..........grouped by country.  I would be looking at a possible 3 bars per country??? Take Hungary for example, I'ld like to see the Blue, Green and Red bars side by side.   Is that an additional dimension?Bars.JPG

sunny_talwar

Do you multiple dimensions and multiple expressions in your application? I think you will need to change somethings around to make this work. Would it be possible to share a sample?

vishsaggi
Champion III
Champion III

May be try this

Chart Properties -> Style Tab -> Check Grouped rather than Stacked.

gfisch13
Creator II
Creator II
Author

Tried that first.......didn't work.  thanks!!

gfisch13
Creator II
Creator II
Author

Here is a sample of what I'm doing?  Yes, two dimensions, Region and Country.

sunny_talwar

Will something like this work for you?

Capture.PNG

gfisch13
Creator II
Creator II
Author

Yes, that would work.  I see your expression on the Axis, where would you enter that??

sunny_talwar

If you open the application I have attached you would see that I replaced you two dimensions with a single dimension. Do that will be added as your dimension

Capture.PNG

gfisch13
Creator II
Creator II
Author

What is the Chr function representing here?

sunny_talwar

Line break... basically pushes Region and Country in two different rows.