Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Assign a Color to a Dimension which is Text

I have a table of results which are by team so

Team sentwinreject
Team B2000851624
Team F1245256950
Team J502100300

What I want to do Is write an expression where it will color each row by team so for example

Team B = Blue()

Team F = Red()

Team J = Green()

in Qlik Sense what would be the expression I would use in the Background color expression box to accomplish this?

Thanks in advance

1 Solution

Accepted Solutions
JonnyPoole
Employee
Employee

You can do a color by expression to dynamically evaluate it.

Pick(Match(Team, 'Team B', 'Team F','Team J'), red(), blue(),green())

In this situation the match() function will evaluate every value in the field named 'Team' and is designed to capture 3 possible choices in sequential order:  B, F, J.

Then the pick() function , in order, will swap out a color expression for those 3 values in sequence:   B->red , F->blue etc...

You can do this as a background expression .. YES

View solution in original post

2 Replies
JonnyPoole
Employee
Employee

You can do a color by expression to dynamically evaluate it.

Pick(Match(Team, 'Team B', 'Team F','Team J'), red(), blue(),green())

In this situation the match() function will evaluate every value in the field named 'Team' and is designed to capture 3 possible choices in sequential order:  B, F, J.

Then the pick() function , in order, will swap out a color expression for those 3 values in sequence:   B->red , F->blue etc...

You can do this as a background expression .. YES

Not applicable
Author

That has worked perfectly Thank you