Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts,
Can anyone tell me how to adjust the below expression so that 'Pass' is green and 'Fail' is red?
=IF(Count({<SLAMet= {'Yes'}>} SLAMet)/Count(SLAMet)>.98,'Pass','Fail')
Thanks!
Colour is set differently in the different object types, but if you know where to put the colour expression then you could use this:
IF(Count({<SLAMet= {'Yes'}>} SLAMet)/Count(SLAMet)>.98,green(),red())
Hi Vegar,
I have tried using KPI and Text & Image but this doesn't seem to work.
Thanks for you post though.
To introduce colors, you need to get their number.
The shade of green I chose was #cbe989, and the red i chose was #ff919b. You can get the numbers by going to the colors tab in Appearance (image attached).
If you're applying this to a table, you can add the below formula. Just replace "Name" with the dimension/measure name. The formula can go in "Background Color Expression" or "Text Color Expression" (Image 2):
if(Name= 'Pass', '#cbe989', '#f9ec86')
Hope this helps.
Thanks, Nesma_Aldash! That's some really helpful info. Unfortunately as I'm trying to display a very simple, large font "Pass" or "Fail" the table option doesn't quite work.
Currently I am using the KPI option and everything works except being able to colour the "Pass" or "Fail" - There is no 'Color Expression' option in KPI, so I was hoping to be able to include the colour prompt within the expression I am already using:
=IF(Count({<SLAMet= {'Yes'}>} SLAMet)/Count(SLAMet)>.98,'Pass','Fail')
Unless you can recommend an object other than KPI that may be appropriate?
Assuming that your color is based on your KPI expression, Count({<SLAMet= {'Yes'}>} SLAMet)/Count(SLAMet), then you can set your colors and the limit where to change color inside the color properties pane (Sorry for the Swedish language in the picture below)
Thanks, Vegar. The expression I am using is:
=IF(Count({<SLAMet= {'Yes'}>} SLAMet)/Count(SLAMet)>.98,'Pass','Fail')
When I go to the color section and turn conditional colors on and library off it displays an error "unable to change the properties because there is an error in the expression".
You don't put the formula for the KPI limit color, just the limit, in your case. .98
Then in the bar above, set the color by clicking it left and right of the .98 line created with the red/green colors you want
Hi @bensomers ,
The please follow these steps.
Create a dimension and give in the expression as =IF(Count({<SLAMet= {'Yes'}>} SLAMet)/Count(SLAMet)>.98,'Pass','Fail') and name it as Flag
then if you extend that dimension you find 'Background Color Expression' and in that give like this
pick(match(Flag,Pass,Fail),rgb(0,255,0),rgb(255,0,0)).
May this helps