Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
glyphs are not working. It always picks one and doesnt show conditionally.
May be can use like the one in attached.
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.
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.
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
Oh sorry, I see now this is for Sense, not sure this applies. Sorry
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!
Which object are you using?
KPI object, Table, Bar, Line?
I'm using KPI!
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.
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?