Transformations
Limit / Head-Tail
Keeps only the first or the last so many rows and drops the rest.
When to use it
Use it for a top-N report after sorting, to cap what is sent to an output, or to work with a small slice of a big file while you build a flow.
In a pipeline
File InputSort RowsLimit / Head-TailExport CSV
Settings
| Setting | Type | Required | Default or hint |
|---|---|---|---|
| Keep | select | — | top |
| Number of rows | number | — | 100 |
Example
The three biggest customers
- Keep=Top (first rows)
- Number of rows=3
| Customer | Revenue |
|---|---|
| Northwind Trading | 98200 |
| Harbour Foods | 76400 |
| Cole & Sons | 51010 |
| Bayside Deli | 9800 |
| Customer | Revenue |
|---|---|
| Northwind Trading | 98200 |
| Harbour Foods | 76400 |
| Cole & Sons | 51010 |
Worth knowing
- The node keeps rows in the order they arrive — put a Sort Rows node in front of it for a real top or bottom N.
- Asking for more rows than there are simply passes every row through.
- Number of rows accepts a variable, e.g. $TopN, so a schedule can change the size without editing the flow.