is there simplier method of doing multiple conditional formating right now i have to nest the conditional: iif(a=b, "Blue", iif(a=c, "Red", iif(a=d, "Green", "Black"))). so if i have 5/6 or more conditions, it will be very messy.
How do you deal with nested if statements that have multiple conditions for one value. for example if you want to have Country='US' and Month =December and week=1 , then return value 12/01-12/07 and if Country=US, Month=December and week=2 then return value 12/08-12/14 and so on.
You can use VB if-then-else statements in the custom code sections by defining a function call, but not directly in an expression. You would then call the function.
Note: iif, choose, switch, etc. can be nested directly in the expression.
In addition, you may want to consider writing a function in custom code (which allows you to define VB functions) or as custom assembly that contains your logic. You can then reuse the function from RDL expressions.
multiple conditional formatting
MikeLing
Scott Coleman
You can use VB if-then-else statements in the custom code sections by defining a function call, but not directly in an expression. You would then call the function.
Note: iif, choose, switch, etc. can be nested directly in the expression.
-- Robert
GoldPantherSPQR
You can use logic operators, e.g. =iif(Fields!Country.Value = "US" AND Fields!Month.Value = "December" ... )
-- Robert
t.Gnewuch
Andorkacska
* =Choose(...)
http://msdn.microsoft.com/library/en-us/vblr7/html/vafctchoose.asp
* =Switch(...)
http://msdn.microsoft.com/library/en-us/vblr7/html/vafctswitch.asp
In addition, you may want to consider writing a function in custom code (which allows you to define VB functions) or as custom assembly that contains your logic. You can then reuse the function from RDL expressions.
-- Robert