Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
Showing results for 
Search instead for 
Did you mean: 
Creator III
Creator III

hardcode the colours in a bar chart.


Can someone help me to solve my change?

Please find the qlik app and the source data attached.

I need to find a way to display all the AMs in a bar chart based on the target.

There are some conditions like:

if the AM value is less than Min Target to be REG, IF the AM value is equal with Medium Target or less than Top Target to be Yellow  and IF the AM value is above Top Target to change the bar to Green.

I need something similar this in the below capture.

Thanks in advance!Capture.PNG



1 Reply

Re: hardcode the colours in a bar chart.

Hi, I am just going to provide some advice as my company does not allow me to download any samples from the qlik community, hence, I cannot answer with specifics.

In your bar chart, you go to the expression tab and open up (click on the + to the left) the expression that you want to change the colour for.  Go to the background colour option and then create an expression there to define your colours, something like:

IF(AMValue < MinTarget , RED() , IF(AmValue = MinTarget , YELLOW() , GREEN() ))


AMValue - Replace this with your expression for AMValue

MinTarget - Replace this with your expression for MinTarget

RED(), YELLOW(), GREEN() - you can replace these with specific RGB values using RGB(n,n,n) to give a very precise colour.