Expressing the Range Argument

The Range argument refers to view-time expanded rows and columns, on which calculations are performed after suppression. Sorting is performed after calculation is completed. The following table explains the expanded range notation:

Table 29. Range Notation  

Type

Notation

Description

Example

None

 

The Range argument is optional.

This row expression points to all expanded rows in row segment 2. row[2]

Note:

This ensures compatibility with earlier releases.

Single Range

[segment (range)]

Refers to the single expanded row or column.

This expression points to expanded row 5 in segment 2:

row[2(5)]

Consecutive Range Reference

[:]

Refers to a range of expanded rows or columns.

This expression points to expanded rows 5,6,7,8,9,10 in row segment 2:

row[2(5:10)]

Nonconsecutive Range references

[,]

Refers to multiple single expanded rows or columns.

The following example points to expanded rows 5, 7, 8 and 10 in row segment 2:

row[2(5,7,8,10)]

If a range is used, you can use any combination of the above range notations.

Example:

The following example points to expanded rows 5 through 10 in design-time row 2:

row[2(5:10)]

Note:

If row segment 2 expands to 15 rows, the function operates on only expanded rows 5 through 10.

Example:

The following example identifies columns C through E in design-time column A:

column[A(C:E)]

Example:

The following example points to expanded rows 1, 3, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15 and 17 in design-time row 2:

row[2(1,3, 5:10, 12:15, 17)] 

Note:

When the grid contains suppression properties, expanded rows and columns may be suppressed. For information on suppressing data, see Conditional Suppression.

If the Range argument refers to a number of expanded rows that is greater than the maximum number of rows expanded in the segment, the extra rows are ignored.

Example:

In the following example, expanded rows 6 through 10 are identified, but segment 1 contains only 3 expanded rows. In this situation, the function works only on expanded rows 6 through 8:

row[1(6:10)]

If none of the expanded rows in the Range exist, the entire axis reference is ignored.

Example:

The following example ignores the reference to 23 if segment 3 only contains 10 expanded rows:

row[3(23)]

Example:

If you enter a larger starting range than ending range, the system internally switches them around.

Example:

The following example shows how the range is reversed:

row[1(7:5)] becomes row[1(5:7)]

Multiple references to the same expanded rows or columns are valid. However, this may cause the same rows or columns to be included twice in an expression.

Example:

The following example sums expanded row 5 twice:

row[2(3,5,7,5)].sum 

Example:

The following example specifies expanded rows 3, 4, 5, 6, 7, and row 5. It includes row 5 twice in the calculation of the average:

row[2(3:7,5)].ave

Identifying Multiple Segments with Ranges

The syntax for a range in a segment range is:

AXIS[Segment Start : Segment End (Range Start : Range End)]

where Segment Start and Segment End refers to multiple segments.

Example:

The following example points to expanded rows 5, 6, and 7 in row segments 1, 2, 3, and 4:

row[1:4(5:7)] 

Example:

The following example points to expanded rows 5, 7, and 9 in row segments 1, 2, 3, and 4:

row[1:4(5,7,9)]

If the segment argument refers to segments that do not exist in the axis, the segments are ignored. This includes suppressed rows or columns.

Example:

The following example points to expanded rows 4, 6, 7,8, 9, and 10 in row segment 1 and 4, 5, and 6 in row segment 3 and all expanded rows in row segment 7:

row[1(4, 6:10); 3(4:6); 7]