Reputation: 15
I am trying to use this expression to change the background colour of a text box within SSRS 2008
=IIF(Fields!Score.Value <=12, "Green", IIF(Fields!Score.Value >=13, "Amber" , IIF(Fields!Score.Value >=19, "Red" ,"White")))
The result is 15 which should pull back an amber colour which it is not doing.
The thresholds for the score field are
High 19-24 Medium 13-18 Low < 12
Upvotes: 0
Views: 640
Reputation: 106
Assuming 'Score' is an INT you just need to swap the tests for >= 13 and >=19 as follows:
=IIF(Fields!Score.Value <=12, "Green", IIF(Fields!Score.Value >=19, "Red" , IIF(Fields!Score.Value >=13, "Orange" ,"White")))
Also 'Amber' isn't a valid colour name so change that to something like 'Orange' too.
Upvotes: 0
Reputation: 1541
Try to convert field value to INT, Might be expression considering this as string
=IIF(CInt(Fields!Score.Value) <=12, "Green", IIF(CInt(Fields!Score.Value) >=13, "Amber" , IIF(CInt(Fields!Score.Value) >=19, "Red" ,"White")))
Upvotes: 1