rows
Selects rows from a table.
You can specify a row by entering its name (string) or by using the rowNames function.
The return value is a table region. If this region comprises a single row, Studio prints the return value as a punctuated list. If the region spans two or more rows, Studio prints an HTML table.
The return value is always a table region, even if it's printed as a punctuated list.
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.
When you select one row, Studio prints the resulting region as a punctuated list.
ATL in Script | Result |
---|---|
| Andrew Gray, 14,000, 8,000, 1,500 and 4,500 |
| Linda Barclay, 16,000, 8,250, 1,500 and 6,250 |
The parameters can take any ATL expression that returns a row name.
ATL in Script | Result |
---|---|
| Emma Moore, 33,000, 19,000, 3,500 and 10,500 |
Note that rowNames(max(Sales))
returns the row name for the row with the highest Sales value.
Note
In a "Describe Row in Context" project, the column variable is SalesColumn
.
When you select two or more columns, Studio prints the resulting region as an HTML table. For example:
[[rows('Aberdeen', 'Inverness')]]
The return value is this table region:
| Manager | Sales | COGS | otherExp | Profit |
---|---|---|---|---|---|
Aberdeen | Andrew Gray | 14,000 | 8,000 | 1,500 | 4,500 |
Inverness | Linda Barclay | 16,000 | 8,250 | 1,500 | 6,250 |