SQL Server Forums
Profile | Register | 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)
 fill color expression
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pavlos
Yak Posting Veteran

Greece
58 Posts

Posted - 05/18/2012 :  02:32:24  Show Profile  Reply with Quote
hey all,

so i have a report and in one coloumn I want to colour code it.
in the current column I have the following expression:
=iif(Fields!Sales.Value=0,"",iif(Fields!Sales_Last_Year.Value=0,"",(Fields!Sales.Value/Fields!Sales_Last_Year.Value)-1))

now in the color fill box I have this expression:
=iif(me.value>0,"LightGreen",iif(me.value<0,"Tomato","LightGrey"))

I want the cell to be shaded grey if there is nothing in the cell, green if the value is positive and red if the value is negative.

currently the numbers will go red and green. but where there is no value it remains a no fill color. I want it to turn grey.

I have also tried:
=iif(me.value="","LightGrey",iif(me.value>0,"LightGreen","Tomato"))

pavlos
Yak Posting Veteran

Greece
58 Posts

Posted - 05/18/2012 :  02:36:59  Show Profile  Reply with Quote
to put it simple
I have the following cell values and want to shade them in the following colors:
15% (positive, shaded green)
-3% (negative, shaded red)
"" (which is nothing, shaded grey)
33% (positive, shaded green)
12% (positive, shaded green)
-4% (negative, shaded red)

in the fill expression window I have tried this:
=iif(me.value>0,"LightGreen",iif(me.value<0,"Tomato","LightGrey"))

only the green and tomato work, not the grey

and
=iif(me.value="","LightGrey",iif(me.value>0,"LightGreen","Tomato"))
this does nothing.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
47189 Posts

Posted - 05/19/2012 :  15:03:39  Show Profile  Reply with Quote
=iif(me.value Is Nothing,"LightGrey",iif(me.value>0,"LightGreen","Tomato"))

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

pavlos
Yak Posting Veteran

Greece
58 Posts

Posted - 05/20/2012 :  20:26:26  Show Profile  Reply with Quote
awesome! thanks!
i also need to re-assign my original text box expression to = nothing and not = ""
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.05 seconds. Powered By: Snitz Forums 2000