Expression Transformation
Expression Transformation
The Expression transformation to calculate values in a single row before it writes into
Target.
For example, you might need to adjust employee salaries, concatenate first and last names,
or convert strings to numbers. You can also use the Expression transformation to test
conditional statements before you pass the results to a target or other transformations.
Example: Create a mapping to sum salary and comm for each employee. (Row level calculation)
Sample Mapping:
1. Connect and Open the folder if not already opened.
2. Select Tools --> Mapping Designer
3. Select Mappings --> Create
It will pop-up "Mapping Name". Enter the mapping name of your choice" and Click on 'OK'.
Example: m_emp_salary
4. Drag the Source and Target definitions into workspace if they are already exist. If not
click here to know how to create or import Table definitions.
or
a) Click on Expression Transformation icon marked below in below snapshot.
7) Select 'exp_employee_salary' Expression Transformation and Right Click --> Edit -->
Ports Tab.
a) Un-Check Output Ports for SAL and COMM
Before: See the port highlighted in red.
After: See the ports highlighted in red.
Add a new port to the transformation and name it 'o_Salary' and check 'Output check box'
as shown above
Click on 'Open Browser' and Write a Expression in "Formula:" box like 'v_Salary' which is
variable value