Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jmialoundama
Specialist
Specialist

Color one dimension according to another dimension

Hi, 

I have a table like that : 

CODE                 LABEL

ADCFD               Test 1

ESKYRMZ         Test 2

12ZSFE45      Test 3

 

I want to color my label in red when CODE = 'ADCFD' with an expression. 

I try like this, but i think something is missing from my expression : 

if(CODE='ADCFD',rgb(255,0,0))

 

Labels (2)
1 Solution

Accepted Solutions
UseCodeMeow
Contributor II
Contributor II

Are you sure that you placed the code under the Label column in the settings?

Color.JPG

The LABEL color will only change its color based on other dimension if you change the Text color expression under the desired column in the table.

View solution in original post

4 Replies
JordyWegman
Partner - Master
Partner - Master

Hi,

The code looks good, but you can try these:

IF(CODE = 'ADCFD','#ff0000',null()) // Hex color
IF(CODE = 'ADCFD',LightRed(),null()) // Qlik color

Can you show an image where you are trying this?

Jordy

Climber 

Work smarter, not harder
jmialoundama
Specialist
Specialist
Author

Hi Jordy,

It's ok for the color of column CODE but i want to color in red the column LABEL when CODE = EBITWO. 

Capture.PNG

I put this expression on QLIK SENSE, but it's doesn't work : 

IF(CODE = 'EBITWO',LightRed(),null())

UseCodeMeow
Contributor II
Contributor II

Are you sure that you placed the code under the Label column in the settings?

Color.JPG

The LABEL color will only change its color based on other dimension if you change the Text color expression under the desired column in the table.

jmialoundama
Specialist
Specialist
Author

Hi UseCodeMeow,

I had made a mistake in the placement of the formula.

By placing the formula in the right place, I get the label in red.

Thank you 🙂