
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Qlik Sense - Get different colors for Negative and positive percentage values from a Variable in KPI
Hi Qlikers,
I am finding it quite a challenge to get different colors for Negative and positive percentage values from a Variable.
My variable name = $( v_P1-P3 YoY )
green -='BE4A47'
Red = '015C55'
Generally above value is negative so green if it becomes positive i want it to be red.
So I tried below
=if($(v_P1-P3 YoY)<0,'BE4A47','015C55')
But the output is
This is where I used it
I want to know whats the measure to use the above colors or want to know if I am using the correct measure at the wrong place? Anyone can help would be great .Thanks
- Tags:
- color
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's far easier then that; in your measure: just leave it as the measure which gives back the %
Then in conditionnal color, add a limit (0) without any ifs ...
with the mouse.. click on the segment before 0 and choose red.. after 0 choose green .. and that would be it

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's far easier then that; in your measure: just leave it as the measure which gives back the %
Then in conditionnal color, add a limit (0) without any ifs ...
with the mouse.. click on the segment before 0 and choose red.. after 0 choose green .. and that would be it

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks @OmarBenSalem it worked !!
For any one who needs more details I did whats above add Limit> 0 then (green) again Add Limit and put 0.999 (red) to make sure all percentage values from -0% to -100% and +0% to +100% is achieved.
If the variable value is -0.1 and -0.9 become green
If the variable value is +0.1 and +0.9 becomes Red

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
