Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Formatting KPIs with units based on value

Hi,

I am trying to change the colour of a KPI based on it's value. This works fine for a number or percentage, e.g. 22 or 55%.

How could I make this work for a number with units, e.g. 22°C?

Many thanks,

Will

19 Replies
YoussefBelloum
Champion
Champion

Hi,

you are trying to do it on what type of object  ?

Regards,

YB

prat1507
Specialist
Specialist

Hi you can use this

=if(keepchar('-5564646fasafafhi56',-1234567890) >0,rgb(0,255,0),rgb(255,0,0))

OmarBenSalem

maybe  if (sum(subfield(YourField,'°',1))>20,green(),red())

sthing like this

Not applicable
Author

HI YB,

It's for a Key Performance Indicator (KPI)

Best regards,

Will

Not applicable
Author

Hi Pryatush,

Thank you very much for your suggestion.

I think there must be something fundamental I am missing - I am not sure into which dialog box to type these expressions.

I have tried typing it into the expressions editor (shown by the green elipse in screenshot 1). I just pasted in your expression as shown by screenshot 2 and received the unexpected result shown in the blue elipse on screenshot 1.

Please would you help me find where to type this expression to affect the formatting?

I appreciate this may be a basic question, but please bear with me whilst I get familiar with QLIKSense.

Many thanks,

Will

prat1507
Specialist
Specialist

Use below steps:

  1. In the properties panel, open Appearance > Colors and legend.
  2. Click the Colors button to switch to Custom.
  3. In the drop-down list, select the option By expression.An expression text box is opened.
  4. Enter your expression in the text box, or click 3 to open the expression editor.


Type the expression given by me into the aforementioned text box, and you can retain your expression to display as it is.


Regards

Pratyush

Not applicable
Author

QLIK Formatting Expression Screenshot 1.png

1.)

QLIK Formatting Expression Screenshot 2.png

2.)

QLIK Formatting Expression Screenshot 3.png

3.)

Hi Pratyush,

Thanks for all your help - I really appreciate the time you're putting into this.

Sorry for not attaching the first two screeenshots (please see above for reference).

The third screenshot shows the appearance tab for the Key Performance Indicators, and I am struggling to find the colors and legend section. Please would you advise me how to access this if it cannot be seen in the tab?

Many thanks,

Will

prat1507
Specialist
Specialist

Hi Will

Click on the dropdown and you'll find by expression. Click on that and then a text box would appear. You can use the expression there.

regards

Pratyush

prat1507
Specialist
Specialist

Dropdown next to the red color circled by you in the last image.


Regards
Pratyush