Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

deepak_km9886
New Contributor III

Color expression in if statement along with condition in kpi

Attached is a sample excel sheet,

i want a value in red and green color in the KPI,

I'm using the below expression to achieve the same,  but not finding the result.

if(E<0,-(E) and red(), 0 and green())

What i'm trying is , if the value of E is less than zero or negative, i am making E positive and i want that to be in red() color and if the value of E is greater than or equal to zero and positive i'm making E to be Zero and i want that to be in green(). but the above expression yields - sometimes.

can anyone help me out stalwar1Screenshot (53).png

Tags (2)
3 Replies
bwisealiahmad
Valued Contributor

Re: Color expression in if statement along with condition in kpi

Hi,

So what if you for your Dimension do:

IF(Value>= 0,0,Value)

And for your Color Expression do:

IF(Value <= 0,Red(),Green())

Capture.PNG

Does that work?


Would do the 0 replacement in script.

Best,

Ali A

deepak_km9886
New Contributor III

Re: Color expression in if statement along with condition in kpi

I want in KPI, not in table. Can you suggest it for sheet which i have shared

robin_heijt
Contributor

Re: Color expression in if statement along with condition in kpi

Hi,

Take a look at this thread, it may supply you with the information you need.

How to show the different colors according to the value displayed in a KPI???

Regards,

Robin

Community Browser