ARRAY

Command

The ARRAY command declares one-dimensional array variables.

Syntax

ARRAY arrayVariableName [dimName] = { constList};

arrayVariableName Comma-delimited list of one or more array variable names.
dimName Dimension whose size determines the size of the array variable. You must surround the dimName with brackets [ ] when using the ARRAY command.
constList Optional list of data values used to initialize the array variable(s). If no initialization is performed, then 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.

Description

This command declares one-dimensional array variables. Typically, arrays are used to temporarily store variables as part of a member formula. The variables are contained within the calc script and cease to exist after the calc script ends. The size of the array variable is determined by the corresponding dimension (e.g., if dimension Period has 12 members, ARRAY Discount[Period] has 12 members). More than one array can be created at the same time. To do so, simply separate the different array declarations with commas within the ARRAY command, as shown in the example that follows.

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.

Example

ARRAY discount[Scenario];

Which 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];

Which yields two arrays, one of 4 members (corresponding to the dimension Scenario, and called discount) and one of 9 members (corresponding to dimension Product, and called tmpProduct).

See Also

VAR


Copyright (c)1991-2000 Hyperion Solutions Corporation. All rights reserved.