Qlik Community

New to Qlik Sense

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

Announcements
Tell us which business and trade publications you read most regularly: RESPOND NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
divya_anand
Creator III
Creator III

Qlik Sense - KPI Object - Conditional Colors

Hi,

I am trying to apply a condition for color in KPI object. I have 3 fields, I would like to show field "A" with color based on fields B & C.

If B>C then A should appear in red, otherwise in green.

Can someone help me achieve this?

I use QlikSense 2.2.4

6 Replies
devarasu07
Master II
Master II

Hi,

Try like below in your field A  background color properties,

your field A

=if(sum(Measure2)>sum(Measure3),Red(),Green())

refer sample app.

1.jpgUse below expression in

divya_anand
Creator III
Creator III
Author

Hi Devarasu,

I need this conditional color for KPI Object, not for a table.

devarasu07
Master II
Master II

Hi,

Can you share your app. tks

shraddha_g
Partner - Master III
Partner - Master III

Add 2 Limits with expression of Measure2 and Measure 3 and then select colors there.

arockiyaselvana
Partner - Creator
Partner - Creator

Hi, I am afraid we cannot achieve this directly. As a workaround, i think we can do the following.

1. first go to color settings in KPI Object. In QS 3.2, it is there under Appearance.

2. Enable the conditional color option.

3. Enter the expression in this format.

If(exp1>exp2, 0.75,0.25)

4. Arrange the limit scroll bar at the center if you want to use only two colors. Or add add more limits.

5. Choose the color from the list by click the on the bar.

kpi.PNG

P.S: You can select color from the list only.

julietotsch
Contributor II
Contributor II

I tried this, but now, my KPI (the first value) is very small. Is there a way to 1) make it bigger and/or 2) Hide the second KPI so it doesn't show in the box?