Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

paisleymike
New Contributor III

Chart colour based on values

Hello

I am creating a bar graph and I am looking to change the colours if they certain bar reach a certain level

Its split into 2 groups

A,B -  Blue

C,D - Red

But I want to make it so that if A or B reach 5 they change colour

same with the rest

i.e.

IF (A => 5 rgb (50,50,100), rgb(0,0,100))

If A reaches 5 or more change colour otherwise stick with being blue

Then same with the rest

If you could help it would be appreciated

Thank you

3 Replies
MVP
MVP

Re: Chart colour based on values

Its split into 2 groups

A,B -  Blue

C,D - Red

How are you splitting this? do you have one or two dimensions? What is your expression?

rittermd
Honored Contributor

Re: Chart colour based on values

Go to Appearance/Colors

Turn off Auto Color and then choose By Expression

Enter your expression something like this but using your fields, values, and colors.  You can replace the Green(), Red() with actual RGB values for more specific colors.

If (Count(distinct {<CurrentActive={1}>} [Employee_ID])/Count(distinct [Employee_ID])=1,Green(),Red())

paisleymike
New Contributor III

Re: Chart colour based on values

Hello

Ive just separated them by a value then coloured them

if([Field] = 'A', rgb(0,0,100),

if([Field] = 'B', rgb(0,0,100),

if([Field] = 'C', rgb(100,0,0),

if([Field] = 'D', rgb(100,0,0),

))))

hope that clears it up

Thank you