November 10, 2010 at 2:10 pm
Guys, I'm trying to write an expression for Visibility feature.
It works fine when I write something like this:
=IIF(Parameters!CodeToDrillDown.Value = 1, TRUE, FALSE)
The users have a range of values to choose from, for instance, codes 1 through 99.
If I write a statement like: =IIF(Parameters!CodeToDrillDown.Value = 1 or 3 or 7 or 11 or 12 or 16 or 25 or 44 or 99, TRUE, FALSE) ...it bombs.
I tried switching the parameters' data type from interger to text and viceversa, but I get the same results.
Any assistance on how to write the code correctly?
Thanks for the help.
November 10, 2010 at 2:46 pm
360Addict (11/10/2010)
Guys, I'm trying to write an expression for Visibility feature.It works fine when I write something like this:
=IIF(Parameters!CodeToDrillDown.Value = 1, TRUE, FALSE)
The users have a range of values to choose from, for instance, codes 1 through 99.
If I write a statement like: =IIF(Parameters!CodeToDrillDown.Value = 1 or 3 or 7 or 11 or 12 or 16 or 25 or 44 or 99, TRUE, FALSE) ...it bombs.
I tried switching the parameters' data type from interger to text and viceversa, but I get the same results.
Any assistance on how to write the code correctly?
Thanks for the help.
I have struggled with an OR based Iif in the past also. I don't remember what my solution was, but here are a couple of ideas.
First I think you need to use the complete expression in between your OR like
Parameters!CodeToDrillDown.Value = 1 OR Parameters!CodeToDrillDown.Value = 3 OR Parameters!CodeToDrillDown.Value = 7 etc.
If that doesn't work try to use a SWITCH statement. Switch is a great replacement for a series of nested IIFs. It is just a series of repeating expressions and response values, it will return the response of the first true expression. Like this:
=SWITCH(Parameters!CodeToDrillDown.Value = 1, True,Parameters!CodeToDrillDown.Value = 3, True,Parameters!CodeToDrillDown.Value = 7, True.....etc)
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy