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
 Development Tools
 Reporting Services Development
 Highlight the Background based on expression

Author  Topic 

stahorse
Yak Posting Veteran

86 Posts

Posted - 2015-01-27 : 07:38:27
Hi

I have a table with 5 columns and I want to put this expression for the background color;
IIf xi > avg(x) + 3*stdev(x) OR xi < avg(x) - 3*stdev(x) THEN highlight


This is what I want to achieve, if column one is XI; then column 2,3,4 is X.
Then do this: Starting from column one, for to highlight column one, I firstly have to get the avg of column 2,3,4 and 5, add it with (3 * standard deviation of column 2,3,4 and 5 values) , then see if the value I get is below column one(which is XI on this instance),

And the same applies for other columns, if I want to see if I can highlight column two, I need to get the avg of column 1,3,4 and 5, then add that with (3 * standard deviation of column 2,3,4 and 5 values) then see if the value I get is below column two(which is XI on this instance).

Please help me on how can I get around this issue, or maybe if that's a better way.

sz1
Aged Yak Warrior

555 Posts

Posted - 2015-01-27 : 08:27:13
Here is an example, some logic you can work with:

Using IIF

=iif((Fields!Agreed_Solved_Date___Time.Value <= DateAdd("s",-1,Fields!Agreed_Solved_Date___Time.Value), "Blue",(iif(Fields!Agreed_Solved_Date___Time.Value = DateAdd("d" ,-1, Fields!Agreed_Solved_Date___Time.Value),"Red", iif(Fields!Agreed_Solved_Date___Time.Value <= DateAdd("d",-2, Fields!Agreed_Solved_Date___Time.Value),"Green", ""))))

Using Switch

Switch(Fields!Agreed_Solved_Date___Time.Value = Today(),"Red",
Fields!Agreed_Solved_Date___Time.Value = DateAdd("d",+1,Today()),"Orange",
Fields!Agreed_Solved_Date___Time.Value >= DateAdd("d",+2, Today()),"Green",
Fields!Agreed_Solved_Date___Time.Value < DateAdd("d",0, Today()),"Blue",
Len(Fields!Agreed_Solved_Date___Time.Value) = 0,"")


We are the creators of our own reality!
Go to Top of Page
   

- Advertisement -