1.3.11.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:

  • Replacements: matches the attribute values against the lookup column in the map. Where there is a match, the matching value is replaced by the value in the right-hand column. Specified as a Reference Data. Default value: None.

  • Ignore case?: determines whether or not to ignore case when matching the lookup column of the map. Specified as Yes/No. Default value: Yes.

  • Match list by: drives how to match the map, and therefore which part of the original value to replace. Specified as a Selection (Whole Value/Delimiter Match). Default value: Whole value.

  • Delimiters: when matching values to the map by splitting the data using delimiters, this allows you to specify the delimiter characters to use. Specified as a free text entry. Default value: Space.

Outputs

Describes any data attribute or flag attribute outputs.

Data Attributes

The following data attributes are output:

  • AllReplaced: a new String or Array attribute from the replaced value(s). Note that where there is no match from the input attribute value to the map, the original attribute value is carried forward into the new attribute.

Flags

The following flags are output:

  • ReplaceAllFlag: indicates whether or not any replacements were made in the record. Possible values are Y/N.

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