|
-
Sep 21st, 2012, 05:00 AM
#1
Thread Starter
Hyperactive Member
nested iif problem
I have an expression to sum a number of fields
=Fields!quarter1.Value+Fields!quarter2.Value+Fields!quarter2.Value+Fields!quarter3
This works correctly as long as there are the 4 fields.
But depending upon what the user has specified there may only be 1, 2, 3 or 4 fields.
If there are not 4 fields it then fails and gives and error.
I thought I could use a switch statement but this also fails as it has to solve each switch element which it cannot do.
I think the answer is to use nested iif statements, but I don't think I have got the nesting correct
"error: [BC30516] Overload resolution failed because no accessible 'IIf' accepts this number of arguments"
Here is a siplified version of my iif statements.
I think I need the nesting deeper but am not sure.
=iif(Parameters!MyParam3.value=1,"Is 1",
iif(Parameters!MyParam3.value=2,"Is 2",
iif(Parameters!MyParam3.value=3,"Is 3",
iif(Parameters!MyParam3.value=4,"Is 4"))))
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|