Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditional Coloring

Hi guys,

I've been trying to do some searching for conditional expressions, but I haven't had any luck so far.

Right now I have two KPIs. One that shows Revenue from 2014 and one from 2015.

I did set analysis to filter the revenue by the year:

2014 Revenue Expression: Sum({$<Year={"FY14"}>}"Revenue")

2015 Revenue Expression: Sum({$<Year={"FY15"}>}"Revenue")


Now, I would like the 2015 Revenue to be a certain color depending on if it's higher or lower than 2014 Revenue (example: red if lower, green if higher).


I checked conditional coloring, but I'm a little confused as to how the expression should be formatted (most likely an if expression?).


Any help would be greatly appreciated. Thanks!

1 Solution

Accepted Solutions
phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

glyphs are not working. It always picks one and doesnt show conditionally.

May be can use like the one in attached.

View solution in original post

26 Replies
stigchel
Partner - Master
Partner - Master

if ( Sum({$<Year={"FY15"}>}"Revenue")- Sum({$<Year={"FY14"}>}"Revenue")<0,red(),green())


You can set these in the the background/text color options for the expression by clicking on the +sign in front of the expression.

Not applicable
Author

Where exactly do I put the expression you wrote?

In the min/max ranges for conditional coloring? That doesn't seem to work.

Thanks for your quick response.

stigchel
Partner - Master
Partner - Master

So where you use these expressions?? In a chart bar/table/pivot/text box??

I was assuming in a chart, in the expression tab click on the plus sign

BgColorDate.png

stigchel
Partner - Master
Partner - Master

Oh sorry, I see now this is for Sense, not sure this applies. Sorry

Not applicable
Author

Yes, I'm using Qlik Sense. Thanks for your help though!

If anyone else knows how to correctly apply conditional coloring in this case, I would greatly appreciate it!

phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Which object are you using?

KPI object, Table, Bar, Line?

Not applicable
Author

I'm using KPI!

phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Assuming you have tow KPI objects one with 2014 and one with 2015.

see attached for the reference. Choose "A2Z Solutions" as customer in the filter.

At a glance what i did is...

1. enable conditional colors for the metric you need to color.

2. add a limit

3. in Min box input 2014 expression

4. in Max box input 2015 expression

5. for lower bound pick green and upper bound pick red.

Not applicable
Author

I understand the way you organized it, but what if 2015 is lower than 2014? Then it wouldn't work as a max. Wouldn't we need an if statement or the like?