Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Doubt Colors in Fields by Expression

Hello,


I'm generating a table where I group for a given service, several tasks. These tasks have different priority (critical, average and low) and I need to display a color map per service.


If any task is critical, turn it red. (regardless of whether you have medium or low tasks)

If any task is average, and has no criticisms, it turns yellow

If all tasks are low, they turn green.

Example:

ServiceTaskColor
Service1

Task 1: Critical

Task 2: Media

Task 3: Media

Task 4: Low

Red
Service 2

Taks 1: Low

Task 2: Low

Task 3: Media

Orange
Service 3

Task 1: Low

Task 2: Low

Task 3: Low

Green


thank you very much!

3 Replies
marcus_sommer

This could be done with the attribut expressions - behind the small plus-signs by dimensions and expressions - with an expression like:

pick(match(Task, 'Critical', 'Media', 'Low'), red(), yellow(), green())

- Marcus

Anonymous
Not applicable
Author

Hi Marcus,

thank you, i Need add a new conditional:

  • If status is assignated and exist some critical, is red,
  • If status is assignated and exist some media and any critical, is yellow
  • if all task, status are closed, is green,
  • If all taks are low, and status is assignated, is green.

Can you help me?

Regards.

marcus_sommer

You could try to concat the conditions like:

pick(match(Status & '|' & Task, 'Assigned|Critical', 'Assigned|Media', ....),

     red(), yellow(), green())

Depending on the conditions it might be easier to use if-loops and/or to combine if-loops with pick(match()) like:

if(Status = 'Closed', green(),

     pick(match(Status & '|' & Task, 'Assigned|Critical', 'Assigned|Media', 'Assigned|Low'),

          red(), yellow(), green())

- Marcus