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: 
YG
Contributor III
Contributor III

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

YG_0-1600679884474.png

This is where I used it

YG_1-1600679926768.png

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

Labels (6)
1 Solution

Accepted Solutions
OmarBenSalem

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

View solution in original post

3 Replies
OmarBenSalem

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

YG
Contributor III
Contributor III
Author

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

 

YG
Contributor III
Contributor III
Author

YG_0-1600735248149.png