Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
mahitham
Not applicable

Bar chart color coding help

Hi Experts,

Can any one please help me on below requirement .

I have applied below color expression in the bar chart for all current year high, low and medium need to show Red, black and grey.

for all previous year high, low and medium need to show orange, yellow and green.

=if(Category='Low' and Year=$(=Max(Year)),RGB(0,0,0),

if(Category='Low' and Year=$(=Max(Year)-1),RGB(255,255,102),

if(Category='High' and Year=$(=Max(Year)),RGB(255,0,0),

if(Category='High' and Year=$(=Max(Year)-1),RGB(255,204,153),

if(Category='Medium' and Year=$(=Max(Year)),RGB(128,128,128),

if(Category='Medium' and Year=$(=Max(Year)-1),RGB(153,255,153)))))))

But when I have selected 2017 then previous year 2016 color coding not working. Please help me on this.

Thanks in advance.

1 Solution

Accepted Solutions
sunny_talwar
Not applicable

Re: Bar chart color coding help

Try this as your expression for color

=Only({1}if(Category='Low' and Year=$(=Max(Year)),RGB(0,0,0),

if(Category='Low' and Year=$(=Max(Year)-1),RGB(255,255,102),

if(Category='High' and Year=$(=Max(Year)),RGB(255,0,0),

if(Category='High' and Year=$(=Max(Year)-1),RGB(255,204,153),

if(Category='Medium' and Year=$(=Max(Year)),RGB(128,128,128),

if(Category='Medium' and Year=$(=Max(Year)-1),RGB(153,255,153))))))))

Capture.PNG

1 Reply
sunny_talwar
Not applicable

Re: Bar chart color coding help

Try this as your expression for color

=Only({1}if(Category='Low' and Year=$(=Max(Year)),RGB(0,0,0),

if(Category='Low' and Year=$(=Max(Year)-1),RGB(255,255,102),

if(Category='High' and Year=$(=Max(Year)),RGB(255,0,0),

if(Category='High' and Year=$(=Max(Year)-1),RGB(255,204,153),

if(Category='Medium' and Year=$(=Max(Year)),RGB(128,128,128),

if(Category='Medium' and Year=$(=Max(Year)-1),RGB(153,255,153))))))))

Capture.PNG