Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Simple Color expression

Author  Topic 

hbadministrator
Posting Yak Master

120 Posts

Posted - 2013-06-19 : 15:09:09
I have a single field I want to color code.

If less than 0 then red if 1-44% then black if 45 and greater Green.

The field name is GP it is a value like .45 but I formatted it to ##.##%. So maybe that is my issue.

Any way this is what I thought I should do.

=IIf(Fields!GP.Value <0, "Red",IIf(Fields!GP.Value > 1 < 44, "Black", IIf(Fields!GP.Value >45, "Green")))

Or if I was to use the report field it would be
=IIf(ReportItems("GP1".Value < 0, "Red",IIf(eportItems("GP1".Value > 1 < 44, "Black", IIf(eportItems("GP1".Value > 45, "Green")))

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-20 : 01:10:14
i think this should work fine
=IIf(val(Fields!GP.Value) <0, "Red",IIf(val(Fields!GP.Value) <= 0.44, "Black", "Green"))


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

hbadministrator
Posting Yak Master

120 Posts

Posted - 2013-06-20 : 09:27:40
Thanks Visakh
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-21 : 02:19:16
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -