I would like to write a Reporting Services "Expression"
that basically behaves as the following (pseudo code)...
if ([Fields!StateProvinceId.Value] == 1)
{
return "Ontario";
}
else if ([Fields!StateProvinceId.Value] == 2)
{
return "Quebec";
}
else if ([Fields!StateProvinceId.Value] == 3)
{
return "Manitoba";
}
// ...
// more cases same pattern
I don't see this type of logic do I have to nest a bunch of IIF?
=IIF(Fields!StateProvinceId.Value = 1, "Ontario", IIF(Fields!StateProvinceId.Value = 2, "Quebec", IFF(Fields!StateProvinceId.Value = 3, "Manitoba", "Unknown Province")))
location. Value = “CA”, “Bold”, “Italic”) SSRS iif statement The format of the IIF() statement is as follows: =IIF(Expression, Condition set when the expression is true, Condition set when the expression is false) It should be a Boolean expression, according to parameter 1.
Using IIF Function in SSRS We are going to add a new field to the report data set to determine if the Order Year is the Max or Current Year. As shown below, the dataset properties window is opened, and the Fields tab is selected. After clicking Add, at the bottom of the list a new field is added.
Also, the expression language used in SSRS is Visual Basic.
Have you tried a switch statement?
= Switch( Fields!StateProvinceId.value=1,"Ontario", Fields!StateProvinceId.value=2,"Quebec", Fields!StateProvinceId.value=3,"Manitoba")
See "decision functions" on this page for example:
http://msdn.microsoft.com/en-us/library/ms157328.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With