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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
JoseGarcia
Creator III
Creator III

Button colour expression

Hi there, 
using a button to show a numerical KPI. 
I want colour to change according to an expression. 
Trying different option, but none although syntax correct, do not show correct colour.
Any ideas?
These are the expression I am trying: 

=if((Avg([apsys_score]) >= 0.00) and (Avg([apsys_score]) < 1.00), RGB(187,42,24),
if((Avg([apsys_score]) >= 1.01) and (Avg([apsys_score]) < 2), RGB(255,118,33),
if((Avg([apsys_score]) >= 2.01) and (Avg([apsys_score]) < 3), RGB(255,207,2),
if((Avg([apsys_score]) >= 3.01) and (Avg([apsys_score]) <= 5), RGB(39,110,39))
)
)
)

or

=if(([apsys_score]) < 1.00, RGB(187,42,24),
if(([apsys_score]) < 2, RGB(255,118,33),
if(([apsys_score]) < 3, RGB(255,207,2),
if(([apsys_score]) <= 5, RGB(39,110,39))
)
)
)

Any ideas or suggestions? 
Thanks 

Labels (1)
1 Solution

Accepted Solutions
RafaelBarrios
Partner - Specialist
Partner - Specialist

hi @JoseGarcia 

try:

=if(AVG([apsys_score]) < 1, RGB(187,42,24),
if(AVG([apsys_score]) < 2, RGB(255,118,33),
if(AVG([apsys_score]) < 3, RGB(255,207,2),
if(AVG([apsys_score]) <= 5, RGB(39,110,39))
)
)
)

also remember you can use color names, blue(), red(), yellow() or better ARGB codes for opacity 

https://help.qlik.com/en-US/sense/May2023/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/ColorFunct...

 

best,

help users find answers! Don't forget to mark a solution that worked for you & to smash the like button!

 

View solution in original post

1 Reply
RafaelBarrios
Partner - Specialist
Partner - Specialist

hi @JoseGarcia 

try:

=if(AVG([apsys_score]) < 1, RGB(187,42,24),
if(AVG([apsys_score]) < 2, RGB(255,118,33),
if(AVG([apsys_score]) < 3, RGB(255,207,2),
if(AVG([apsys_score]) <= 5, RGB(39,110,39))
)
)
)

also remember you can use color names, blue(), red(), yellow() or better ARGB codes for opacity 

https://help.qlik.com/en-US/sense/May2023/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/ColorFunct...

 

best,

help users find answers! Don't forget to mark a solution that worked for you & to smash the like button!