Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customers, Partners & Luminaries only: You're invited to a Data Analytics Roadmap session. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

speficy color based on a certain value in my bar chart

Hi Guys,

I have a bar chart with diffrent delaycodes. This is there a way I can appointed a speficy color based on a certain value in my bar chart?

I tried this in the dimension tab and in my expression. However without any success.

This is my expression:

if(DelayCode='Ontime',

RGB(80,202,28),

If(Match(DelayCode='AIR', 'SEA', 'CONSOL'),

RGB(222,38,38),

count(Order)/count(total Order)))

it seems that the color settings in the color tab are overrulling my expression. Is my expression btw OK?

Hope some one can help or point me to the right direction.

Thanks in advance!

Isam

1 Solution

Accepted Solutions
Highlighted
Champion
Champion

see the attached file for your refrence

you can change the color code

in backgroung use this code

if(DelayCode='OnTime',

red(),

if(Match(DelayCode, 'CONSOL', 'CONSOL SEA', 'ELL', 'EMBARGO AIRLINES', 'OnTime', 'OurFault', 'SASO', 'SYNC'),

blue()))

View solution in original post

7 Replies
Highlighted
Employee
Employee

You need to put the color expression as "Background Color" subexpression, not in the main expression.

Highlighted
Creator
Creator

Hi Johan,

If you mean in the dimension tab under ‘background color’. I already did that. Didn’t work.

Cheers

iSam

Highlighted
Champion
Champion

in expression you can write

count(Order) / Count(Total Order)

and at Background Color expression you can write

if(DelayCode='OnTime',

RGB(80,202,28),

if(Match(DelayCode= 'CONSOL', 'CONSOL SEA', 'ELL', 'EMBARGO AIRLINES', 'OnTime', 'OurFault', 'SASO', 'SYNC'),

RGB(222,38,38)))

hope this helps

Highlighted
Creator
Creator

Hi Sunil,

I already tried that and that didn’t work. L L

isam

Highlighted
Creator
Creator

Hi sunil,

I retried that solution, however with no success. L

Isam

Highlighted
Champion
Champion

see the attached file for your refrence

you can change the color code

in backgroung use this code

if(DelayCode='OnTime',

red(),

if(Match(DelayCode, 'CONSOL', 'CONSOL SEA', 'ELL', 'EMBARGO AIRLINES', 'OnTime', 'OurFault', 'SASO', 'SYNC'),

blue()))

View solution in original post

Highlighted
Creator
Creator

Thanks Sunil,

I added the expression the under the Dimensions tab rather then the Expressions tab. That's why it wasn't working.

Thanks for your help!

iSam