Skip to main content

sortedRows

Selects rows from a table and presents them in the selected order.

This function is similar to rows. Both functions return a table region of selected rows, but sortedRows presents the rows in the selected order, not the order in your sample data.

Note

Available in "Describe the Table" and "Describe Row in Context" projects only.

Parameters

  • ROW NAME (string)

    A row you wish to select.

  • ROW NAME (string)

    Optional. Another row you wish to select.

  • ROW NAME (string)

    Optional. Another row you wish to select.

Notes

  • You can select as many rows as required.

  • You can input a row name (string) or an ATL expression that returns a row name.

Examples

Assume a "Describe the Table" project with this data:

Branch

Manager

Sales

COGS

otherExp

Profit

Row 1

Aberdeen

Andrew Gray

14,000

8,000

1,500

4,500

Row 2

Edinburgh

Emma Moore

33,000

19,000

3,500

10,500

Row 3

Inverness

Linda Barclay

16,000

8,250

1,500

6,250

Row 4

Glasgow

Louise Scott

32,500

17,750

1,700

13,050

Note

The first table column — Branch in the table above — contains the row names.

The following ATL selects the rows for Glasgow, Aberdeen, and Edinburgh.

[[sortedRows('Glasgow', 'Aberdeen', 'Edinburgh')]]

The return value is this table region:

 

Manager

Sales

COGS

otherExp

Profit

Glasgow

Louise Scott

32,500

17,750

1,700

13,050

Aberdeen

Andrew Gray

14,000

8,000

1,500

4,500

Edinburgh

Emma Moore

33,000

19,000

3,500

10,500

The row order (top to bottom) reflects the order of selection (left to right) in the function call.

Note

The same ATL would work in a "Describe Row in Context" project.