Replace Replace

The handler replaces the source data set data using replacement tables. The replacement tables contain couples of the replaced and new values or regular expressions that enable to compute them. It is possible to set these tables manually in the wizard (internal) or send to the handler port (external).

Sequence of the replacement algorithm actions:

  1. First of all, it is required to search and replace by the exact match with the values specified in the replacement table.
  2. The search among the values not found by exact match is performed by regular expressions. Such expressions can be set in the internal replacement tables. New values are also computed using regular expressions.
  3. Replacement rules are observed for the values not found at the previous steps.

Input

  • Input data source Input data source (data table): the data set to be changed.
  • Data set Joined table [N] (data table): the data set that contains a replacement table.
  • Add port Add another port. As several replacement tables are possible, the ports required for them can be added by a user.

Output

  • Output data set Output data set (data table). When configuring port columns mapping, it is possible to select columns replacement or addition options.

Wizard

The wizard window consists of three areas:

  1. Replacement methods.
  2. Replacement table.
  3. Additional parameters.

Replacement Methods

Replacement method is set for each field of the source data set:

  • Do not replace: the output data set won't be replaced.
  • Manual input: the internal replacement table is used.
  • Replacement table (Replacement table N): the external replacement table is used. This method is available in the settings if the external replacement table data is supplied to the input handler port.

Replacement table N: the name of the table accepting port.

Replacement Table

It displays the external or internal replacement table for the selected field of the source data set.

Configuration of the Internal Table

To enter the new row into the replacement table, it is required to use Add row button. The table can contain rows for search and replacement according to the following requirements:

Important: In the case of replacement of the numeric data, it is required to consider the intervals into which this or that replaced value is included.

Example

Let's consider the following table:

Value
5
10
15

There are the following replacement types: 1) 5 => -5; 2) 15 => -15.

And precision is equal to 5.

In this case, the output table will be as follows:

Value
-5
-15
-15

So, there are two half-intervals: [5, 10) and [10, 15). Thus, the bound values are included into the interval in which they are the initial ones.

When entering the replacement table manually, the following actions are available by means of the area toolbar:

  • Import Import provides import of the replacement table from the text file with a particular structure.
  • Export Export provides export of the replacement table to the text file.
  • Sort Sort enables to sort the table by field of the source value.
  • Change replacement type enables to set data type of the column with new values.
  • Edit current replacement Edit current replacement enables to display the editing area of the current string of the substitution table.
  • Get values Get values enables to load the drop-down list called by  button to the Value field in the case of the manual input of the replacement table.

Note: Replacement by exact match prevails over replacement by regular expression.

Configuration of the External Table

It is required to select Usage type for the table fields from the following options:

  • Not used Not used: the replacement table field won't be used.
  • Value Value: the field contains replaced values.
  • Replace Replace: the field contains new values.
  • Info Info: the field contains an additional option of the new value. Additional replacement options are displayed in the resulting data set in the form of a separate column.

Note: If one value can be replaced according to conditions of several replacement table rows, the first one must prevail. Thus, table sorting can have an impact on the processing result. This rule is not applied when using the allowable interval (refer to Precision parameter).

Additional Parameters

  • Replace other contains replacement options of the values that have not been found using the replacement table.
    • Do not replace: no replacement is performed.
    • With empty: values will be replaced with Null.
    • With value: values will be replaced with the specified value.
    • With regular expression: the new value will be calculated using the regular expression syntax.
  • Precision: enables to set the allowable interval based on the values specified in the replacement tables for the integer and real fields. In this case, the source value will be replaced.
  • Case-sensitive strings: the checkbox installs the case-sensitive mode of values search in the replacement tables. This mode is not used by default.

results matching ""

    No results matching ""