← All nodes
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

Settings

SettingTypeRequiredDefault or hint
Count column nametext—Count
Expected count (optional — stops the run if different)number—No check

Example

Stamping the batch size

  • Count column name=Count
Input rows
OrderAmount
A-10411240
A-1042860
A-1043312.5
Result
OrderAmountCount
A-104112403
A-10428603
A-1043312.53

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.

Others in Transformations