← All nodes
Transformations

Surrogate Key

Adds a warehouse surrogate key: a counting number, a pattern you write, or a UUID — a key that belongs to your warehouse rather than to the source system.

When to use it

Use it when loading a dimension or staging table that needs its own key, independent of whatever ids the source system uses.

In a pipeline

Settings

SettingTypeRequiredDefault or hint
New Column NametextYesSurrogate Key
Insert Afterselect—End of table
Key Formatselect—number
PatterntextYesKEY-{seq:6}
Start Fromnumber—1
Stepnumber—1

Example

A readable key for a customer dimension

  • New Column Name=Customer Key
  • Insert After=End of table
  • Key Format=Pattern
  • Pattern=CUST-{yyyy}-{seq:5}
  • Start From=1
Incoming rows
Source IdName
A-19Acme
H-4Harbour Foods
Keys the warehouse owns
Source IdNameCustomer Key
A-19AcmeCUST-2026-00001
H-4Harbour FoodsCUST-2026-00002

Key Format Number gives plain 1, 2, 3 — the usual choice for a dimension key — and UUID gives a random id per row.

Worth knowing

  • Pattern tokens: {seq} is the counter and {seq:5} pads it to five digits, {uuid} is a random id, {yyyy} {yy} {MM} {dd} {HH} {mm} {ss} are the run's date and time, and any other name in braces is read from that row's column, such as {Region}-{seq:4}.
  • Start From and Step control the counter, so a later load can carry on where the last one stopped.
  • A pattern with neither {seq} nor {uuid} repeats itself on rows with the same values; the node says so when it happens.
  • Keys are handed out in the order the rows arrive, so put this node after any sorting or filtering.

Others in Transformations