Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculated bar color in bar chart

Hi all,

I have a chart over a single dimension, which shows turnaround time if it's within the required window, or "Late" otherwise:

=if([DE TAT Days]< [TAT Required], [DE TAT Days], 'Late')

I want to color the bars based solely on the same fields used in the dimension, so that Late cases are red, 1 day prior is yellow, and earlier is green, like so:

if([DE TAT Days]< [TAT Required] - 1,Green(),if( [DE TAT Days]< [TAT Required], Yellow(), LightRed()))

However, the color expression always defaults to the else case (LightRed). This is true even if I replace [TAT Required] with a constant value (e.g. 7).

5 Replies
vishsaggi
Champion III
Champion III

Try this?

= if([DE TAT Days] < ([TAT Required] - 1), Green(),

  if([DE TAT Days] < [TAT Required],       Yellow(), LightRed()))

Anonymous
Not applicable
Author

Still goes all the way to the LightRed else case.

josephinetedesc
Creator III
Creator III

Hi Patrick

I did this by adding a separate expression for "over 60", 50 to 60 etc

Jo

Capture1.GIF

vishsaggi
Champion III
Champion III

can you share your qvw file where you are trying this, so that it will be easy to work on?

karthikoffi27se
Creator III
Creator III

Hi Patrick,

Can you share your QVW file please.

Many Thanks

Karthik