Conditional Mapping using a Mapping Script

With conditional mapping, source members are mapped to script expressions rather than to hard-coded target members. Conditional mappings are valid only for rule-based mapping (Between, In, and Like). You can activate conditional mapping by placing #SQL in the Target value column for a SQL script. The row that uses a script has a target value of #SQL. Then the next row has the <!SCRIPT> delimiter and the actual script, followed by <!SCRIPT>. Conditional mapping, in conjunction with dimension processing order, enables a mapping based on the results of dimension mappings. That is, dimension mappings that have already been processed. See Using Mapping Scripts.

Note:

In Data Management, Jython script is not supported for conditional mapping (#SCRIPT cannot be used in the Target value column.)

To apply conditional mapping:

  1. On the Workflow tab, under Data Load, select Data Load Mapping.
  2. In Data Load Mapping, click Add.

    A blank row is added.

  3. From Dimensions, select the dimension name.
  4. Select either the Between, In, or Like tab.
  5. Enter source values in the Source Value range.
  6. In Target Value, enter #SQL.

    The pencil icon is enabled.

    Image shows the Data Load Mapping screen
  7. Click the pencil icon.
  8. On the Edit Script screen, specify your SQL script.

    This sample script uses the SQL Cast statement to conditionally process assigned values for the target column.

    Image shows the Edit Script screen.

    Data Management does not perform an error check or validate the script. You need to test the script on your data files in a test environment and verify the results.

  9. In Rule Name, specify the data load rule to use with the mapping script.
  10. Click Save.