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

Colors by expression help.

Hey everyone,

Making a simple bar chart here and trying to get my colors by expression to work. They are still all the same color. Here is my example data.

attend.PNG

I am trying to get the table to show the percentage of employees every day based on Area_Emp.

So first I need to get Actual_Emp/FTE_Emp to get percentage, then make that either blue if below .95% or red if over .95%.

Here is the expression I am using.

Created a variable vAttend =Sum({$<Date_Emp={"$(=Date(Today()-3))"}>} (Actual_Emp / FTE_Emp))

Color expression in bar graph

if (sum(vAttend) < 0.95, '#f93f17', '#f93f17')

Currently they are all red.

44 Replies
joshrussin
Creator III
Creator III
Author

yes

joshrussin
Creator III
Creator III
Author

Could you attach the sample file for this to see what I could be doing wrong, please? Thanks!

joshrussin
Creator III
Creator III
Author

Any luck?

vishsaggi
Champion III
Champion III

Hey so sorry was stuck with work. Will check in a while.

sunny_talwar

Remove the equal sign from your variable

Capture.PNG

Capture.PNG

balabhaskarqlik

Try this:

Expression: =if ('$(vAttend)' > 0.95, red(), blue())


vishsaggi
Champion III
Champion III

Strange, why i am unable to open this file in Qlik Sense? Sunny any help on how you open this file?

joshrussin
Creator III
Creator III
Author

I see it working. I've made all the changes I need to but still only shows red in my app.

sunny_talwar

I have no idea....

sunny_talwar

Seeing red in the attached app also?