Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Michael_Tarallo
Employee
Employee

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

Regards,
Mike Tarallo
Qlik

View solution in original post

7 Replies
sunny_talwar

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

Michael_Tarallo
Employee
Employee

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

Regards,
Mike Tarallo
Qlik
sunny_talwar

Look at the sample for your reference.

Best,

Sunny

sunny_talwar

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

Michael_Tarallo
Employee
Employee

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

Regards,
Mike Tarallo
Qlik
Anonymous
Not applicable
Author


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

Vince_CH
Creator III
Creator III

Hello Mike, i cannot see the setting of min/max for color changes on my Qlik sense desktop free version, is it? or my Qlik sense version is too old?


@Michael_Tarallo wrote:

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