Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
joshrussin
Creator III
Creator III

Coloring by expression

I have a bar graph and when the percentage is over 95% the color should be blue, and if it is under 95% it should be red.

It has been working until I figured out I need to convert the time zone.

I created a variable to get yesterdays percentage called "vAttend"

the formula that has been working:

vAttend = Sum({$<Date_Emp={"$(=FirstWorkDate(Today()-1,1,$(vHolidays)))"}>} (Actual_Emp / FTE_Emp))

when I try to convert to a different time zone, it doesn't work

Sum({$<Date_Emp={"$(=FirstWorkDate(ConvertToLocalTime(Date(now()), 'GMT-05:00')-1,1,$(vHolidays)))"}>} (Actual_Emp / FTE_Emp))

Here is the expression for the colors I am using.

=if($(vAttend) < 0.95, 'rgb(204, 0, 0)', 'rgb(68,119,170)')

Any ideas how to fix?

1 Solution

Accepted Solutions
qv_testing
Specialist II
Specialist II

Remove Quotes, that should work


=if($(vAttend) < 0.95, rgb(204, 0, 0), rgb(68,119,170))



View solution in original post

2 Replies
qv_testing
Specialist II
Specialist II

Remove Quotes, that should work


=if($(vAttend) < 0.95, rgb(204, 0, 0), rgb(68,119,170))



joshrussin
Creator III
Creator III
Author

that worked, but I also had to put a parenthesis around the entire vAttend equation for some reason. Qlik is very sensitive.