Creating an Expression Transformation 143
Creating an Expression Transformation
Use the following procedure to create an Expression transformation.
To create an Expression transformation:1.
In the Mapping Designer, click Transformation > Create. Select the Expressiontransformation. Enter a name for it (the convention is EXP_
TransformationName
) andclick OK.
2.
Create the input ports.If you have the input transformation available, you can select Link Columns from theLayout menu and then drag each port used in the calculation into the Expressiontransformation. With this method, the Designer copies the port into the new transformation and creates a connection between the two ports. Or, you can open thetransformation and create each port manually.
Note:
If you want to make this transformation reusable, you
must create each portmanually within the transformation.
3.
Repeat the previous step for each input port you want to add to the expression.
4.
Create the output ports (O) you need, making sure to assign a port datatype that matchesthe expression return value. The naming convention for output ports isOUT_
PORTNAME
.
5.
Click the small button that appears in the Expression section of the dialog box and enterthe expression in the Expression Editor.To prevent typographic errors, where possible, use the listed port names and functions.If you select a port name that is not connected to the transformation, the Designer copiesthe port into the new transformation and creates a connection between the two ports.Port names used as part of an expression in an Expression transformation follow stricterrules than port names in other types of transformations:
♦
A port name must begin with a single- or double-byte letter or single- or double-byteunderscore (_).
♦
It can contain any of the following single- or double-byte characters: a letter, number,underscore (_), $, #, or @.
6.
Check the expression syntax by clicking Validate.If necessary, make corrections to the expression and check the syntax again. Then save theexpression and exit the Expression Editor.
7.
Connect the output ports to the next transformation or target.
8.
Select a tracing level on the Properties tab to determine the amount of transaction detailreported in the session log file.
9.
Click Repository > Save.
Leave a Comment