Overview
The Split transformation sends each input record down one of several named outputs, based on a condition you set for each output. Use it when records need different handling depending on their values. For example, send valid orders to your warehouse, refunds to a finance sheet, and everything else to an error log. Split replaces the pattern of a Clone followed by several Filters with opposite conditions. With that pattern the conditions drift apart over time, and records are lost or duplicated. With Split, each record is evaluated once against an ordered list of conditions, so every record lands where you expect. Every output carries the input’s fields unchanged. Only the records differ.Configuration
1
Drag a Split component onto the canvas and connect its input.
2
Under Send each row to, choose First match or All matches.
3
Each output has its own tab. Click + Add output to add one, then on its tab enter a name and build its condition the same way as in the Filter transformation. A tab marked with a warning icon still needs a name or a condition.
4
Optionally turn on Add Otherwise output to keep the records that match no condition.
5
Connect each output connector on the canvas to the next component. Every output must be connected.
How records are routed
In First match mode every input record lands in exactly one output when Otherwise is on, so the output record counts add up to the input count.
Connections
- Every named output must be connected to exactly one component. A package with an unconnected output is not valid; the validation error names the output.
- Each output must go to a different component. Two outputs of the same Split can’t be connected to one component, including a Union. To combine their records again, add a Select after each output and connect the Selects to the Union.
- To send one output’s records to several places, connect it to a Clone component.
- When Add Otherwise output is on, the Otherwise output must be connected too. Turning it off removes its connection.
Previewing
Each output’s tab has a Preview under its conditions that shows the records that output receives. When Add Otherwise output is on, an Otherwise tab previews the records no output takes. In First match mode an output’s preview leaves out records an earlier output already took, exactly as the job does. The preview reads a sample of source records. If none of them match an output’s condition, that output’s preview is empty even though a full run may fill it.Example
Orders arrive with anemail and an amount field. Configure a Split in First match mode: