Creating Mapping Scripts

For Like mappings, you can create mapping scripts to designate conditional mapping. This type of mapping enables you to specify source members mapped to script expressions rather than to hard-coded target members. Target values are assigned in the script value. You activate the mapping script by placing #SQL in the Target value field for a SQL script. (The row that uses a script has target value of #SQL). Then the next row has the <!SCRIPT> delimiter and the actual script, followed by <!SCRIPT>. Mapping scripts, used in conjunction with dimension processing order, enables a mapping that is based on the results of dimension mappings. That is, dimension mappings that have already been processed. See Using Mapping Scripts.

To create a mapping script:

  1. From the Workflow tab, select Data Load Mapping.
  2. Optional: Select the desired location.
  3. Select the Like tab.

    Mapping scripts are unavailable for "Explicit" and "Multi-dimension" mapping types.

  4. Select the Source Value.
  5. In Target Value, enter #SQL to designate a SQL script.

    For SQL based mappings, Data Management specifies the special value #SQL to the "Target Value." For this reason, this field cannot be used to specify a value of "IGNORE." To flag a row, use either VALID_FLAG = "Y" (row if valid), VALID_FLAG = "N" (row if invalid), or VALID_FLAG = "I" (row is ignored based on the user defined criteria).

    For example, if you want to map null entries so that they are ignored, specify the data table column for the dimension and then specify VALID_FLAG = "I." In the following example UD3 identifies the data table column for the product dimension.

    Image shows the Script Editor

  6. In Rule Name, enter the data rule name for the mapping.
  7. Click Save.

    The Script Editor icon (Image shows Script Editor icon) is enabled.

  8. Click the Script Editor icon.
  9. In Edit Script, enter the mapping script, and click OK.

    The example below shows how you might specify an SQL script as a target value.

    Image shows Edit Script screen