1.3.10.35 Replace All
The Replace All processor uses a Reference Data map to transform data across multiple attributes. Values specified in the first column of the map are replaced by the corresponding value in the second column.
The replacement performed may be a simple whole value replacement - for example to replace the country name 'France' with the ISO standard country code 'FR', or it may use delimiters to split the data in the input attribute into tokens which are considered separately. The way the Reference Data is matched, and thus the data is replaced, is controlled using one of the following options:
-
Whole value
-
Delimiter match
The matching against the Reference Data may also be case sensitive or case insensitive.
If you choose to use the Delimiter match option, and split up the data before matching using delimiters, any of the split values that match the lookup column of the replacement map will be replaced, even if there are many matches in the input value.
Use the Replace All processor to replace one value with another across multiple attributes. Common examples include a string intended to represent 'no data', and conversion of country names to ISO standard country codes across multiple fields.
The following table describes the configuration options:
Configuration | Description |
---|---|
Inputs |
Specify a set of attributes in which you want to replace values using a reference data map. The attributes may be Strings, or String Arrays. If an array is input, the replacements will be made at the array element level, and an array (with the data after the replacements have been performed) will be output. |
Options |
Specify the following options:
|
Outputs |
Describes any data attribute or flag attribute outputs. |
Data Attributes |
The following data attributes are output:
|
Flags |
The following flags are output:
|
The following table describes the statistics produced by the profiler:
Statistic | Description |
---|---|
Transformed |
The number of records where a replacement was performed. Drill down on the number to see the records. |
Untransformed |
The number of records where a replacement was not performed. |
Output Filters
The following output filters are available:
-
Records with transformed values
-
Records with untransformed values
Example
In this example, the Replace All processor is used to convert ISO standard two-character country codes into standardized country names. The replace operation is applied to two attributes simultaneously, eliminating the requirement for multiple replace processors. The following is an excerpt from the drill-down view of transformed records:
AddressCountryCode | AddressCountryCode.AllReplaced | OperatingCountryCode | OperatingCountryCode.AllReplaced |
---|---|---|---|
GL |
GREENLAND |
GR |
GREECE |
US |
UNITED STATES |
FI |
FINLAND |
CZ |
CZECH REPUBLIC |
MG |
MADAGASCAR |
PL |
POLAND |
JO |
JORDAN |
HN |
HONDURAS |
RS |
SERBIA |
UG |
UGANDA |
KG |
KYRGYZSTAN |
KI |
KIRIBATI |
ZA |
SOUTH AFRICA |
MH |
MARSHALL ISLANDS |
MG |
MADAGASCAR |