February 7, 2008 at 4:30 pm
Hello,
I have a field on my SRS Report called new_Region. I prompt the user to enter a value from 1-4. I need the new_Region field on my report to display the text below.
1 means "West"
2 means "Central"
3 means "East"
4 means "Atlantic"
So I tried creating this IIF statement, but I don't know
how to group it so that it works properly. Right now I'm
getting a #Error displaying in the field.
IIF (Fields!new_Region.Value=1, "West", "")
IIF (Fields!new_Region.Value=2, "Central", "")
IIF (Fields!new_Region.Value=3, "East", "")
IIF (Fields!new_Region.Value=4, "Atlantic", "")
Thanks
February 21, 2008 at 3:36 am
replace iif with select case....
February 24, 2008 at 5:36 pm
alternatively, nest the four IIF statements inside each other, so that the "false" part of the first IIF, contains the next IIF statement
for example:
IIF (Fields!new_Region.Value=1, "West", IIF (Fields!new_Region.Value=2, "Central", ""))
but the CASE method makes for much easier reading / debugging! 🙂
February 25, 2008 at 10:22 am
Try the Switch function:
=SWITCH(Fields!new_Region.Value=1, "West",
Fields!new_Region.Value=2, "Central",
Fields!new_Region.Value=3, "East",
Fields!new_Region.Value=4, "Atlantic")
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply