Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

rank_nandha
Contributor II

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


Hi All,

I have a KPI value which change according to the filter selection. I want to show Red text if the value is below a range (i.e., 1,400,000) Green text if the value is above a range (i.e., 1,400,000). I tried the below expression in "Conditional Colors" of Max segment in Data tab. Can some one help me how to do this? Please refer the images

If(Sum(ALLOCATION_COUNTER)>1,400,000,RGB(0,255,0),If(Sum(ALLOCATION_COUNTER)<0,RGB(255,0,0),RGB(0,0,255)))

Pic1.png

Pic2.png

Regards,

Nandha

1 Solution

Accepted Solutions
Employee
Employee

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

Hello Nandha

Please copy .qvf file to your C:\Users\<user profile>\Documents\Qlik\Sense\Apps and refresh Qlik Sense Desktop with F5

Please mark the appropriate replies as CORRECT / HELPFUL so our team and other members know that your question(s) has been answered to your satisfaction.

Regards,

Mike Tarallo

Qlik

6 Replies
MVP
MVP

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

I am guessing that you are using the above expression on the Font tab of text box object's properties? If you are you just need to remove commas from 1,400,000 because you don't need to specify those. Try this:

If(Sum(ALLOCATION_COUNTER)>1400000,RGB(0,255,0),If(Sum(ALLOCATION_COUNTER)<0,RGB(255,0,0),RGB(0,0,255)))


I hope this will work.


Best,

Sunny

Employee
Employee

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

Hello Nandha,

The colors are fixed with the defined color pallet, did you attempt to use that?

I assume you are using the KPI chart object, correct?

The expression only accepts a numeric value not a color code. I will attach a sample, when I get to my machine.

Regards,

Mike T

Qlik

MVP
MVP

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

Look at the sample for your reference.

Best,

Sunny

MVP
MVP

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

Just realized this is Qlik Sense discussion. The qvw might not be useful in that case, but do try the expression. I feel commas is what seems to throwing off your expression.

Best,

Sunny

Employee
Employee

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

Hello Nandha

Please copy .qvf file to your C:\Users\<user profile>\Documents\Qlik\Sense\Apps and refresh Qlik Sense Desktop with F5

Please mark the appropriate replies as CORRECT / HELPFUL so our team and other members know that your question(s) has been answered to your satisfaction.

Regards,

Mike Tarallo

Qlik

rank_nandha
Contributor II

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


Thanks a lot Mike. This works perfect. I have written the expression in Max segment instead i enterted the value it works fine now.