< Previous | Next >

Lesson 4.4: Adding a rule to split values into different output columns

In this lesson, you add a rule that splits a value and maps each part of the split value to a different output column.

Overview

Records in input data might contain information that is concatenated. For example, the input data might contain the value 195CM. This value concatenates 195, which represents an amount, and CM, which represents a unit of measure. To distinguish the amount from the unit of measure, you can add a rule that maps each part of the input value to a different output column.

Procedure

  1. Click the Rules tab, select the Input_Overrides rule group, and then click Open.
  2. Expand Pattern Rule. A list of patterns in the data is shown.
  3. Expand B+>CTT, and then click Unhandled Records. An example record is shown. One of the values in the record, which is represented in the pattern as >, includes leading digits followed by letters.
    In the example record, the value 2LITERS includes a leading digit, 2, followed by letters.
  4. If the example record on the Define Rule page is not TRAILCHEF CANTEEN 2LITERS BROWN COOKING GEAR, select TRAILCHEF CANTEEN 2LITERS BROWN COOKING GEAR from the list of example records. If TRAILCHEF CANTEEN 2LITERS BROWN COOKING GEAR is not in the list of example records, increase the number of records in the list.
    1. In the upper-right corner of the Browse Rules pane, click Example Record Settings button.
    2. From the Records to Display list, select 100.
    3. Click OK. The list of example records includes TRAILCHEF CANTEEN 2LITERS BROWN COOKING GEAR. You can select the record from the list.
  5. Map the values from the example record to the appropriate output columns by dragging the values to the column. The following table shows the output column for each value.
    Table 1. Output columns for each value in the record
    Value Output column
    TRAILCHEF ProductBrand
    CANTEEN ProductName
    2LITERS SizeUnit
    BROWN ProductColor
    COOKING ProductType
    GEAR ProductType
    The values from the example records are mapped to the output columns. However, the value in the SizeUnit output column contains a value that belongs in the SizeType output column.
    The value TRAILCHEF is in the ProductBrand output column. The value CANTEEN is in the ProductName output column. The value 2LITERS is in the SizeUnit output column. The value BROWN is in the ProductColor output column. The values COOKING and GEAR are in the ProductType output column and are separated by a space.
  6. In the SizeUnit output column, right-click 2LITERS, and then click Edit Action. In the Action windows, you can manipulate the data that is sent to the output column.
  7. Edit the action to add only the leading digits to the SizeUnit output column:
    1. From the Object list, select Prefix.
    2. Click All leading digits. The Example Result field shows the value 2.
  8. Click Specify action for remaining characters, and then click OK. The Actions window opens. Options are selected that specify an action for the characters that you did not map to the SizeUnit output column.
    The Actions window is open for the > class. In the example record, the value 2LITERS is assigned to this class. In the Object section of the window, everything but the prefix that consists of all leading digits is selected. The example result for the value is LITERS.
  9. Map the remaining characters to the SizeType output column:
    1. From the Output Column list, select SizeType.
    2. Click OK.
    The values are shown in the correct output columns.
    The value TRAILCHEF is in the ProductBrand output column. The value CANTEEN is in the ProductName output column. The value 2 is in the SizeUnit output column. The value LITERS is in the SizeType output column. The value BROWN is in the ProductColor output column. The values COOKING and GEAR are in the ProductType output column and are separated by a space.
  10. Apply the rule to the pattern:
    1. Click Apply as New Rule.
    2. In the Name field, enter Split size values.
    3. Click OK.
The rule is added and is shown under the B+>CTT pattern.
A rule that is named Split size values is added for the pattern B+>CTT.
< Previous | Next >