• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 412
  • Last Modified:

subscript must be between 1 and the size of the array

This is my record selection formula
  or
    (
      If {?a}[1]= "test" then
      (
        ({table.field}=0)
      )
    )  
    or
    (
     
      If {?a}[2]= "test1" then
      (
        ({table.field}=1)
      )
    )  
    or
    (
      If {?a}[3]= "test2" then
      (
        ({table.field}=2)
      )
    )  

This parameter field {?a} is a multiple selection criteria.

if i add only "test" as a parameter value I get an error subscript must be between 1 and the size of the array at this line If {?a}[2]= "test1" then

0
PradeepYadhav
Asked:
PradeepYadhav
1 Solution
 
bdreed35Commented:
The problem is that you are trying to check for an element of the range parameter that doesn't exist.

You would be better off taking a different approach.
Start off by editing your parameter.
I assume you have default values for the user to pick from.
Since the textual description doesn't match the value stored, you can set up description and values paris for the default values.
The description will be displayed for the user to choose from, and the value will be used in the selection criteria.
Add 0 to your default list, then highlight it, and click the Define Descirpiton button.
Add the description "test" in the description box.
Repeat these last 2 steps for each value you need.
There is a drop down list underneath the default values called Display.  Change this to Description.
Save and Close the parameter dialog box.

Now, all you need for your record selection is:

 {table.field} = {?a}
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now