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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Simple Color expression
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

hbadministrator
Posting Yak Master

120 Posts

Posted - 06/19/2013 :  15:09:09  Show Profile  Reply with Quote
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

India
52326 Posts

Posted - 06/20/2013 :  01:10:14  Show Profile  Reply with Quote
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 - 06/20/2013 :  09:27:40  Show Profile  Reply with Quote
Thanks Visakh
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 06/21/2013 :  02:19:16  Show Profile  Reply with Quote
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000