Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Brilliant,
thanks again for the clarification. I'm sorry for being slow but I still don't quite follow.
When I have a normal number in the field e.g. 300, I can edit the expression as you mention:
When my KPI has units as below, the field reads: "unable to change the properties because there is an error in the expression"
Do you know how I might proceed for such a field?
Many thanks,
Will
Hi Will
No issues. Can you please tell me what expression have you used to get 22 deg Celsius.
Regards
Pratyush
This is the expression: Temperature reads 22°C from a .csv file
I don't find any problem with this. The expression seems to be correct.
You can use if(keepchar(Temperature,-0123456789)>0,rgb(0,255,0),rgb(255,0,0)) in the Color expression.
Regards
Pratyush
Do you know how I can write a color expression? Unfortunately with the expression I screenshotted I am still seeing the error shown above: "unable to change the properties because there is an error in the expression".
I had assumed this was because there are units on the end of it, since when I type num(left(Temperature,2)) into the expression for the measure I can change the color without issues.
Do you know how I can type the expression for colour when I am receiving the error shown above?
Many thanks,
Will
ok, can you use num(left(Temperature,2)) & right(Temperature,2)
Plz check with the above expression.
Regards
Pratyush
I have tried this as shown above, but I am still receiving the same error as when I used the expression Temperature
Use this to show degree celsius icon.
Click on number formatting,choose custom.
and add °C in format pattern.
Regards
Pratyush
After you're done with this.
Go to Appearance tab-> Go to Color
Enable Conditional Colors
Click on Add Limit (remember only once)
Below that there will be fx text box
Type this exp =if(Temperature>0,0.25,0.75)
You can select colors by clicking on the sections you want
Sorry, but change the expression to =if(Temperature>0,0.75,0.25).
Sorry, it was a trouble from my part, I haven't used a KPI either in qliksense, but finally it worked out for me, I hope it works out for you too.
Regards
Pratyush