• Passive and connected transformation.
Use the Expression transformation to calculate values in a single row before we write to the target.
For example, we might need to adjust employee salaries, concatenate first and last names, or convert strings to numbers.
Use the Expression transformation to perform any non-aggregate calculations.
Example: Addition, Subtraction, Multiplication, Division, Concat, Uppercase conversion, lowercase conversion etc. We can also use the Expression transformation to test conditional statements before we output the results to target tables or other transformations.
Example: IF, Then, Decode There are 3 types of ports in Expression Transformation:
• Variable: Used to store any temporary calculation.
Calculating Values : To use the Expression transformation to calculate values for a single row, we must include the following ports:
• Input or input/output ports for each value used in the calculation: For example: To calculate Total Salary, we need salary and commission.
• Output port for the expression: We enter one expression for each output port. The return value for the output port needs to match the return value of the expression. We can enter multiple expressions in a single Expression transformation. We can create any number of output ports in the transformation.
Example: Calculating Total Salary of an Employee
• Import the source table EMP in Shared folder. If it is already there, then don’t import.
• In shared folder, create the target table Emp_Total_SAL. Keep all ports as in EMP table except Sal and Comm in target table. Add Total_SAL port to store the calculation.
• Create the necessary shortcuts in the folder.
1. Open folder where we want to create the mapping.
2. Click Tools -> Mapping Designer.
3. Click Mapping -> Create -> Give mapping name. Ex: m_totalsal
4. Drag EMP from source in mapping.
5. Click Transformation -> Create -> Select Expression from list. Give name and click Create. Now click done.
6. Link ports from SQ_EMP to Expression Transformation.
7. Edit Expression Transformation. As we do not want Sal and Comm in target, remove check from output port for both columns.
8. Now create a new port out_Total_SAL. Make it as output port only.
9. Click the small button that appears in the Expression section of the dialog box and enter the expression in the Expression Editor.
10. Enter expression SAL + COMM. You can select SAL and COMM from Ports tab in expression editor.
11. Check the expression syntax by clicking Validate.
12. Click OK -> Click Apply -> Click Ok.
13. Now connect the ports from Expression to target table.
14. Click Mapping -> Validate
15. Repository -> Save Create Session and Workflow as described earlier. Run the workflow and see the data in target table.
Syntax: ERROR(‘Any message here’) Similarly, we can use ABORT function to abort the session if COMM is null.
Syntax: ABORT(‘Any message here’) Make sure to double click the session after doing any changes in mapping. It will prompt that mapping has changed. Click OK to refresh the mapping. Run workflow after validating and saving the workflow. Performance tuning : Expression transformation is used to perform simple calculations and also to do Source lookups. 1. Use operators instead of functions. 2. Minimize the usage of string functions. 3. If we use a complex expression multiple times in the expression transformer, then Make that expression as a variable. Then we need to use only this variable for all computations.
Teradata (33) Informatica (3) Informatica scenarios (3) Data warehousing Quiestions (2) Locking table for access? (2) PL/SQL (2) SQL Queries (2) Unix (2) AUGUST 15th (1) Architecture of UNIX (1) Basic Unix Commands (1) Constraint-Based Loading (1) Data Warehouse Schemas (1) Data warehousing Quiestions1 (1) Debugger (1) Downloads (1) ETL Process (1) Fundamentals of UNIX (1) Get top 5 records to target without using rank (1) Home (1) How do you perform incremental logic or Delta or CDC (1) Incremental Loading for Dimension Table (1) Informatica Complete Reference (1) Informatica Functions (1) Informatica Powercenter Architecture (1) Informatica Quiestions (1) Informatica Quiestions3 (1) Informatica Real time Scenarios (1) Integration Testing (1) Introduction of Unix (1) Oracle (1) Oracle Queries (1) PL/SQL Exception (1) PL/SQL Looping (1) PL/SQL Programs (1) Power center Client (1) Separate rows on group basis (1) TESTING-User Acceptance Test (1) Target Load Order (1) Teradata Latest FAQ's (1) Teradata SQL assistant (1) Teradata main (1) Unit Testing (1) What is informatica (1) informatica project (1)