Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
CasperQlik
Creator
Creator

Help with color expression

Hi Qlik Community

I'm having some troubles with conditional coloring.

I have a line graph like below with 2 measures. It is the 2 measures in %. 

I need to color each line with a distinct color code and not the default values.

I'm using the color by expression but cant get the desired outcome. I have a flag that should control the color.

When flag_field = 1, color 1 and when flag_field = 0, color 2 should be applied.

CasperQlik_0-1712227631395.png

 

Any help is appreciated.

2 Replies
Amit_B
Creator
Creator

If I understand correctly, try as I did in one of my apps:

I defined the following expression in a variable:
='If(Year = Year(Today()-1), RGB(87,97,204), RGB(158,158,158))'

In the line chart I set the variable like that:
$(vYearColor)

CasperQlik
Creator
Creator
Author

I used a master measure to get the desired result.