Tabular OperatorsFilter Operators
take
Returns up to the specified number of rows from the input table.
Returns up to the specified number of rows from the input table. There is no guarantee which rows are returned unless the input is sorted.
Syntax
take countLimit output to N rows
Parameters
| Name | Description |
|---|---|
| count | Maximum number of rows to return |
Examples
Example 1
datatable(warrior:string, weapon:string)[
"Ragnar", "axe",
"Bjorn", "sword",
"Lagertha", "spear",
"Ivar", "bow",
"Floki", "hammer"
]
| take 3| warrior (string) | weapon (string) |
|---|---|
| Bjorn | sword |
| Lagertha | spear |
| Ragnar | axe |
Example 2
datatable(ship:string, crew:long)[
"Naglfar", 80,
"Wave Rider", 45,
"Storm Bear", 60
]
| sort by crew desc
| take 2| ship (string) | crew (long) |
|---|---|
| Naglfar | 80 |
| Storm Bear | 60 |