ARRAY

Declares one-dimensional array variables.

Syntax

ARRAY arrayVariableName [dimName] = { constList};
ParameterDescription

arrayVariableName

Comma-delimited list of one or more array variable names.

dimName

Dimension whose size determines the size of the array variable. Surround dimName with brackets [ ].

constList

Optional list of data values used to initialize the array variable(s). If no initialization is performed, the array variables are set to #MISSING. The order of the values corresponds to the order of the members in the dimension used to define the array.

Notes

  • Typically, arrays are used to temporarily store variables as part of a member formula. The variables cease to exist after the calculation script ends. The size of the array variable is determined by the corresponding dimension (for example, if dimension Period has 12 members, ARRAY Discount[Period] has 12 members).

  • To create multiple arrays simultaneously, separate the array declarations in the ARRAY command with commas, as shown in the Example.

  • You can calculate data for an array directly as part of a member formula. As the member formula is processed, each value in the array is assigned as its member is evaluated in the calculation.

  • Do not use quotation marks (") in variables; for example:

    ARRAY "discount"

Example

ARRAY discount[Scenario];

yields an array of 4 entries, with the values 1 through 4 entered in those four entries.

ARRAY discount[Scenario] = {1, 2, 3, 4};
ARRAY discount[Scenario], tmpProduct[Product];

yields two arrays:

  1. discount, corresponding to Scenario and containing four members

  2. tmpProduct, corresponding to Product and containing nine members

See Also

  • VAR