Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

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
Employee
Employee

Re: Assign a Color to a Dimension which is Text

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

2 Replies
Employee
Employee

Re: Assign a Color to a Dimension which is Text

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

Re: Assign a Color to a Dimension which is Text

That has worked perfectly Thank you