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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register 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([apsys_item_id] = 'EP06' and [apsys_score] < 1, 'red',
if([apsys_item_id] = 'EP06' and [apsys_score] < 2, 'orange',
if([apsys_item_id] = 'EP06' and [apsys_score] < 3, 'yellow',
if([apsys_item_id] = 'EP06' and [apsys_score] >= 3, 'green', 'white')
)
)
)

Labels (1)
1 Solution

Accepted Solutions
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Or you can use color function: https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/ColorFunc...

 

Like:

 

if([apsys_item_id] = 'EP06' and [apsys_score] < 1, red(),
if([apsys_item_id] = 'EP06' and [apsys_score] < 2, lightred(),
if([apsys_item_id] = 'EP06' and [apsys_score] < 3, yellow(),
if([apsys_item_id] = 'EP06' and [apsys_score] >= 3, green(), white())
)
)
)

Help users find answers! Don't forget to mark a solution that worked for you!

View solution in original post

2 Replies
MartW
Partner - Specialist
Partner - Specialist

the syntacs of the formula is correct. the only thing you need to do is change the red, orange, yellow, etc. to there hex colors 

for example change 'red' --> '#FF0000' and do this for all colors and it will work

Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Or you can use color function: https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/ColorFunc...

 

Like:

 

if([apsys_item_id] = 'EP06' and [apsys_score] < 1, red(),
if([apsys_item_id] = 'EP06' and [apsys_score] < 2, lightred(),
if([apsys_item_id] = 'EP06' and [apsys_score] < 3, yellow(),
if([apsys_item_id] = 'EP06' and [apsys_score] >= 3, green(), white())
)
)
)

Help users find answers! Don't forget to mark a solution that worked for you!