Splitting an input row into multiple outputs based on input conditions
Often, it is required to filter input data into multiple outputs depending upon given criteria, for instance, splitting customer data by region, as in this example, or by team. Another very common example is to split the input data into validated records and records that have been rejected due to having failed a quality check (see Checking a column against a list of allowed values in Chapter 3, Validating Data for examples of using tMap to filter invalid rows).
This recipe shows how the tMap
output Expression filters are used to perform filtering of the nature described precedingly.
Getting ready
Open the job jo_cook_ch04_0060_multipleOutputs
.
How to do it...
When you open
tMap
you will see three identical output tables- Click the Expression filter button for the table UK to open an expression field, as shown in the next screenshot.
Drag the input column
countryOfBirth
into this box.Add
.equals("UK")
to the end of the expression...