Transformations
Row Count
Adds the number of rows as a column on every row, and can stop the run when the count is not the one you expect.
When to use it
Use it to stamp a record count onto a report or a log line, or as a guard: a nightly load that must have exactly 5,000 rows fails loudly instead of quietly sending a short file.
In a pipeline
File InputRow CountLoggingExport CSV
Settings
| Setting | Type | Required | Default or hint |
|---|---|---|---|
| Count column name | text | — | Count |
| Expected count (optional — stops the run if different) | number | — | No check |
Example
Stamping the batch size
- Count column name=Count
| Order | Amount |
|---|---|
| A-1041 | 1240 |
| A-1042 | 860 |
| A-1043 | 312.5 |
| Order | Amount | Count |
|---|---|---|
| A-1041 | 1240 | 3 |
| A-1042 | 860 | 3 |
| A-1043 | 312.5 | 3 |
Worth knowing
- Leave Expected count empty for no check. With a number in it, any other count stops the run with a message naming both numbers — put a Logging node downstream to catch it instead.
- If a column with the same name already exists it is replaced and moved to the end.
- The count is taken where the node sits, so place it after any Filter Rows whose result you want counted.