0

I'm linking 2 multi-value parameters together. So that when the user chooses "1" for Fields.P1.Label(0), I get "1" for Fields.P2.Label(0), "2" for Fields.P1.Label(0), I get "2" for Fields.P2.Label(0), etc.

I made it work with the following switch function that I attributed to the Parameters!P2 default value(s):

=Switch(Trim(CStr(Parameters!P1.Label(0)))="1", 
"[Episode].&[1]",
Trim(CStr(Parameters!P1.Label(0)))="2", 
"[Episode].&[2]",
 [and so on for my other 3 possible options])

It works just fine as long as the user checks off the same number of values for my multi-value P1 parameter as the number set as default for P2 (ex.: if P2 has 5 default values set, I must check off 5 values on P1 or I get an error) This is my problem. My user could decide to only choose 1 value, 2 or even 5. So, I created a total of 5 default values for Parameter!P2 by simply copy/pasting the same code but changing Parameters!P1.Label(0) to Parameters!P1.Label(1), Parameters!P1.Label(2), and so on up to Parameters!P1.Label(4).

Here is where I get my problem, since now, if I don't choose 5 values for my P1 I get an error message... I tried fixing it by addiing switch and isnothing to my P2 default values 2 to 5, but I get another error message instead:

=IIF(IsNothing(Parameters!1.Label(1)), Nothing, Switch([same code as above]

Long story short, regardless of whether P1 has 1 or 5 values chosen, I need to set my P2 so that it auto-fills the corresponding values from P1. Any suggestions? Thanks!

Bob
  • 467
  • 1
  • 4
  • 13
  • I fail to see any benefit of referencing the same multi-value parameters from one to another? But if you set P1 and P2 to be "text" , no default value for P1, P2 to have the default value of : =(JOIN(Parameters!P1.Value,",")). This would satisfy this requirement and then convert them to using Cint when referencing the usage in the dataset. – SuperSimmer 44 Jun 30 '17 at 16:15
  • @philipwebb Thanks Philip! This suggestion and a bit of fiddling gave the right result. P.S. In reality, my P1 and P2 contain different values; I just thought using 1, 2, 3, etc. would make it more visual. Perhaps, using digits and letters would have been more representative of my situation. Thanks again. – Bob Jul 05 '17 at 14:51

0 Answers0