Another method for validating a column is to refer to a lookup containing a list of allowed values that can be stored in any format (file, table, XML for example).
Open the job jo_cook_ch03_0050_tMapValuesInLookup
.You will see that there are two inputs to the tMap: customer and country.
Open
tMap
, and drag the fieldcountryOfBirth
from the customer input to thecountryName
field in the country input. This will create a key link, as shown in the following screenshot:Click the button tMap settings and set the value for Join Model to
Inner Join
.In the reject output, click on the button for tMap settings, and set the value for Catch lookup inner join reject to
true
.Run the job and you will see that three of the records have been rejected.
Re-open the
tMap
and change the Expr.key on the country toStringHandling.UPCASE(customer.countryOfBirth)
Re-run the job and you will see that now only one record has been rejected.