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)
 Using IN on conditional formatting

Author  Topic 

sz1
Aged Yak Warrior

555 Posts

Posted - 2013-02-26 : 10:31:37
Hi

Is it possible to use an IN statement to add more numbers to the below?


=iif((Fields!SeventyFive_Percent.Value = 37800), "Green",(iif(Fields!Ninety_Percent.Value = 77760, "Green", iif( Fields!OneHundred_Percent.Value = 86400, "Red", ""))))

So using IN


=iif((Fields!SeventyFive_Percent.Value IN ("37800","37801"), "Green",(iif(Fields!Ninety_Percent.Value = 64800, "Green", iif( Fields!OneHundred_Percent.Value = 21600, "Red", ""))))

SZ1
Learning and development is the driving force in the universe...!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-02-26 : 23:20:18
In is not supported inside SSRS. You've to write it by means of set of conditions separated by Or

=iif((Fields!SeventyFive_Percent.Value = "37800" Or Fields!SeventyFive_Percent.Value = "37801" , "Green",(iif(Fields!Ninety_Percent.Value = 64800, "Green", iif( Fields!OneHundred_Percent.Value = 21600, "Red", ""))))

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

Go to Top of Page

sz1
Aged Yak Warrior

555 Posts

Posted - 2013-02-27 : 05:17:22
Agh ok thanks that will do it, just a bit long winded.

SZ1
Learning and development is the driving force in the universe...!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-02-27 : 05:19:21
you're welcome

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

Go to Top of Page

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-02-27 : 07:56:42
Another option, which is a bit more readable, especially if you have several colors that you want to pick from would be to use the SWITCH construct. A brief description and example is here: http://msdn.microsoft.com/en-us/library/ms157328.aspx
Go to Top of Page

sz1
Aged Yak Warrior

555 Posts

Posted - 2013-02-27 : 09:48:51
Thanks

SZ1
Learning and development is the driving force in the universe...!
Go to Top of Page
   

- Advertisement -