# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

cancel
Showing results for
Did you mean:
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

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

Labels (7)

• ### Variable definition

1 Solution

Accepted Solutions
Partner

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

3 Replies
Partner

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

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

Contributor III
Author

Tags
Community Browser