Expressing the Segment Argument

The Segment argument is a value that represents a row or column ID in the designer. Referenced segments refer to design-time rows or columns, which might expand in the viewer. View-time rows and columns are the expanded rows and columns. You can use numbers for row IDs and letters for column IDs. You can refer to one or more segments in any standard formula. The following table explains the types of notation used for multiple segments in standard formulas.

Table 16.  Segment Notation

Type

Notation

Description

Example

Single segment

[ ]

Single (design-time) segment

This expression points to segment 2: row[2]

Note:

Previous releases support this notation.

Nonconsecutive segment

[;]

Refers to multiple single rows or column segments.

This expression points to segment rows 2, 5, 7, 8 and 10:

row[2;5;7;8;10]

Note:

Use a semicolon rather than a comma to delineate row or column references.

Segment Range

[:]

Refers to a range of rows or column segments.

This expression points to segment rows 2, 3, 4 and 5:

row[2:5]

You can use any combination of the above.

Example:

Point to segment rows 1, 3, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15 and 17:

  row[1; 3; 5:10; 12:15; 17]

Example:

If the following expression references row segment 20, but the grid contains only 15 row segments, the formula works only on segment 4:

  row[4; 20]

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

Example:

Show how the segments are internally switched:

  row[6:3] becomes row[3:6]

Multiple references to the same segments are valid. This causes the same segments to be included twice in an expression.

Example:

Sum row 5 twice:

  row[2;3;5;7;5].sum 

Example:

Reference row segments 2, 3, 4, 5, 6, 7, and segment 5 again. It includes segment 5 twice in the calculation of the average:

  row[2:7;5].avg 

Text segments are ignored.

Example:

Ignore row segment 3 if it is a text row:

  row[1:5]