Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
raghavsurya
Partner
Partner

Multiple colour in bar chart for same expression

Hi All,

I need to get different colour for a Bar when the value is in negative.

For example : I have a bar chart where dimension is Cost centre with values A,B,C,D,E and profit is the expression where it shows five Bars for each cost centre. suppose if Cost centre D is have loss....the bar depicting net loss for cost centre should show in red colour wherein other bars should show in Green.

Is there a way to do it.

Thanks and Regards,

Raghav

1 Solution

Accepted Solutions
sparur
Specialist II
Specialist II

you should use background color expression. See in Expression tab on your expression and use like this:

if(sum(Amount )<0, red(), green())

View solution in original post

4 Replies
sparur
Specialist II
Specialist II

you should use background color expression. See in Expression tab on your expression and use like this:

if(sum(Amount )<0, red(), green())

View solution in original post

kji
Employee
Employee

Add a Background color subexpression to your expression in which you put if(profit>0, Green(), Red()).

Not applicable

Hi Raghav,

Apart from color change, it is also possible to avoid shift in zero base of chart.

i.e. even negative value bar will go up (like positive values) but color will be changed.

Just look at the attachment.

Sincere Regards,

RBA

raghavsurya
Partner
Partner
Author

Hi All,

Thanks a lot.... its working for me.

Regards,

Raghav