Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Text color for a dimension

Hi,

I have a straight table chart where I am trying to change the text color for one of the dimensions using this:

=if(project_health_code='Green', green (), 'Yellow', yellow (), 'Red', red(), Black ())

Does anyone have any idea what's wrong with my syntax?  If the dimension value is green, I want the text display in green, yellow, yellow, etc. 

This works:

=if(project_health_code = 'Green', green(), Black()) but only for one color/value.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

you have to change the expression :

don't use my expression, it was just an example.

but use :

if( project_health_code='green' , green(), if(project_health_code='Yellow', Yellow(), if (project_health_code='Red',Red() ,Black())))

regards

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Hi guy,

you can use multiple if like this :

if(Sum (val1)='Green', green (), if(Sum (val1)='Yellow', yellow (), if(Sum (val1)='Red', red(), Black ())))

I think that there is a smarter way to do this. I have a look and let you know.

Anyway you could use this for the moment. It might be working.

Regards.

Not applicable
Author

Hi,

It said that teh expression was ok but it did not change the color of my text.

Anonymous
Not applicable
Author

you have to change the expression :

don't use my expression, it was just an example.

but use :

if( project_health_code='green' , green(), if(project_health_code='Yellow', Yellow(), if (project_health_code='Red',Red() ,Black())))

regards

Not applicable
Author

Thanks, this works.