Table of Contents

Search

  1. Preface
  2. Using the Designer
  3. Working with Sources
  4. Working with Flat Files
  5. Working with Targets
  6. Mappings
  7. Mapplets
  8. Mapping Parameters and Variables
  9. Working with User-Defined Functions
  10. Using the Debugger
  11. Viewing Data Lineage
  12. Comparing Objects
  13. Managing Business Components
  14. Creating Cubes and Dimensions
  15. Using the Mapping Wizards
  16. Appendix A: Datatype Reference
  17. Appendix B: Configure the Web Browser

Designer Guide

Designer Guide

Defining Expression Strings in Parameter Files

Defining Expression Strings in Parameter Files

The Integration Service expands mapping parameters and variables when you run a session. If you use a mapping parameter or variable in an expression, the Integration Service expands the parameter or variable after it parses the expression. You might want the Integration Service to expand a parameter or variable before it parses the expression when you create expressions to represent business rules that change frequently. Define the expressions in a parameter file so you do not have to change the mappings every time the business rules change.
For example, you create an expression that generates a color name based on an ID string as follows:
IIF(color=‘A0587’,‘white’)
The next month, you modify the expression as follows:
IIF(color=‘A0587’,‘white’,IIF(color=‘A0588’,‘off white’))
Instead of updating the mappings that use this expression every time the business rule changes, you can define the expression in a parameter file and update the file when the expression changes.
To define an expression in a parameter file, set up the mapping and workflow as follows:
  1. Create a mapping parameter or variable to store the color name expression. For example, create a mapping parameter, $$ExpColor.
  2. For mapping parameter $$ExpColor, set the IsExprVar property to true. You must also set the datatype for the parameter to String or the Integration Service fails the session.
  3. In the Expression transformation, set the output port to the following expression:
    $$ExpColor
  4. Configure the session or workflow to use a parameter file.
  5. In the parameter file, set $$ExpColor to the correct expression. For example:
    $$ExpColor=IIF(color=‘A0587’,‘white’)
Because IsExprVar for mapping parameter $$ExpColor is set to true, the Integration Service expands the parameter before it parses the expression. Rows with color ID “A0587” return the string “white.” If IsExprVar is set to false, the Integration Service expands the parameter after it parses the expression. Therefore, all rows return the string “IIF(color=‘A0587’,‘white’).”
When the color name expression changes, you can update the value of the mapping parameter in the parameter file. You do not need to modify the mapping.

0 COMMENTS

We’d like to hear from you!