Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

cancel
Showing results for 
Search instead for 
Did you mean: 
aboumejjane
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
TigerisBack
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
kji
Employee
Employee

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

aboumejjane
Creator
Creator
Author

Hi Johan,

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

Cheers

iSam

TigerisBack
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

aboumejjane
Creator
Creator
Author

Hi Sunil,

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

isam

aboumejjane
Creator
Creator
Author

Hi sunil,

I retried that solution, however with no success. L

Isam

TigerisBack
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

aboumejjane
Creator
Creator
Author

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