Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 65

Informatica Training

DESIGNER

Transformation
The transfer of data is called transformation A transformation is a repository object that generates, modifies, or passes data The Designer provides a set of transformations that perform specific functions Transformations in a mapping represent the operations the Informatica Server performs on the data. Data passes into and out of transformations through ports that you link in a mapping or mapplet.
:

Transformation
Transformations can be active or passive

An active transformation can change the number of rows that pass through it
A passive transformation does not change the number of rows that pass through it, Transformations can be connected to the data flow An unconnected transformation is not connected to other transformations in the mapping It :is called within another transformation, and returns a value to that transformation.

Tasks to incorporate a transformation into a mapping


Create the transformation

Configure the transformation


Link the transformation to other transformations and target definitions

Mapping Designer
Transformation Developer Mapplet Designer

Expression Transformation
You can use the Expression transformation to calculate values in a single row before you write to the target

You can use the Expression transformation to test conditional statements.

You can use the Expression transformation to perform any non-aggregate calculations.

Creating an Expression Transformation

In the Mapping Designer, choose Transformation-Create. Select the Expression transformation.

Ports in expression transformation


Create the input ports

Repeat the previous step for each input port you want to add to the expression.

Create the output ports (O) you need

Setting expression in expression transformation

Enter the expression in the Expression Editor you have disable to in port.

Check the expression syntax by clicking Validate

Connect to next transformation


Connect the output ports to the next transformation or target.

Select a tracing level on the Properties tab


Normal

Tracing level

Choose Repository-Save.

Sorter Transformation
The Sorter transformation allows you to sort data. You can sort data in ascending or descending order according to a specified sort key.

You can also configure the Sorter transformation for case-sensitive sorting, and specify whether the output rows should be distinct.
The Sorter transformation is an active transformation. It must be connected to the data flow. You can sort data from relational or flat file sources.

Sorter Transformation
When you create a Sorter transformation in a mapping, you specify one or more ports as a sort key and configure each sort key port to sort in ascending or descending order.

You can also use the Sorter transformation to sort data passing through an Aggregator transformation configured to use sorted input. You also configure sort criteria the PowerCenter Server applies to all sort key ports and the system resources it allocates to perform the sort operation.

Sorter Transformation
Following Figure illustrates a simple mapping that uses a Sorter transformation. The mapping passes rows from a sales table containing order information through a Sorter transformation.

Sorter Transformation
The Sorter transformation contains only input/output ports. All data passing through the Sorter transformation is sorted according to a sort key. The sort key is one or more ports that you want to use as the sort criteria. You can specify more than one port as part of the sort key. When you specify multiple ports for the sort key, the PowerCenter Server sorts each port sequentially. The order the ports appear in the Ports tab determines the succession of sort operations.

Sorter Transformation
At session run time, the PowerCenter Server sorts data according to the sort order specified in the session properties. The sort The Sorter transformation treats the data passing through each successive sort key port as a secondary sort of the previous port.

Sorter Transformation
Following Figure shows the Ports tab configuration for the Sorter transformation sorting the data in ascending order by order ID and item ID:

Sorter Transformation
Sorter Cache Size The PowerCenter Server uses the Sorter Cache Size property to determine the maximum amount of memory it can allocate to perform the sort operation. The PowerCenter Server passes all incoming data into the Sorter transformation before it performs the sort operation.

Sorter Transformation
Case Sensitive The Case Sensitive property determines whether the PowerCenter Server considers case when sorting data. When you enable the Case Sensitive property, the PowerCenter Server sorts uppercase characters higher than lowercase characters.

Work Directory You must specify a work directory the PowerCenter Server uses to create temporary files while it sorts data. After the PowerCenter Server sorts the data, it deletes the temporary files. You can specify any directory on the PowerCenter Server machine to use as a work directory. By default, the PowerCenter Server uses the value specified for the $PMTempDir server variable.

Filter Transformation
The Filter transformation allows you to filter rows in a mapping. You pass all the rows from a source transformation through the Filter transformation, and then enter a filter condition for the transformation. All ports in a Filter transformation are input/output, and only rows that meet the condition pass through the Filter transformation.

Filter Transformation
The mapping in following passes the rows from a human resources table that contains employee data through a Filter transformation. The filter only allows rows through for employees that make salaries of 30,000 or higher.

Filter Transformation

Filter Transformation
With the filter of SALARY > 30000, only rows of data where employees that make salaries greater than $30,000 pass through to the target. As an active transformation, the Filter transformation may change the number of rows passed through it. A filter condition returns TRUE or FALSE for each row that passes through the transformation, depending on whether a row meets the specified condition. Only rows that return TRUE pass through this transformation. Discarded rows do not appear in the session log or reject files.

Filter Transformation Tips


Use the Filter transformation early in the mapping. To maximize session performance, keep the Filter transformation as close as possible to the sources in the mapping. Use the Source Qualifier transformation to filter. The Source Qualifier transformation provides an alternate way to filter rows. Rather than filtering rows from within a mapping, the Source Qualifier transformation filters rows when read from a source.

The main difference is that the source qualifier limits the row set extracted from a source, while the Filter transformation limits the row set sent to a target.

Troubleshooting Filter Transformations


Case sensitivity. The filter condition is case-sensitive, and queries in some databases do not take this into account. Appended spaces. If a field contains additional spaces, the filter condition needs to check for additional spaces for the length of the field. Use the RTRIM function to remove additional spaces. To filter out rows containing null values or spaces, use the ISNULL and IS_SPACES functions to test the value of the port. For example, if you want to filter out rows that contain NULLs in the FIRST_NAME port, use the following condition: IIF(ISNULL(FIRST_NAME),FALSE,TRUE)

Router Transformation
A Router transformation is an Active Transformation A Router transformation is similar to a Filter transformation because both transformations allow you to use a condition to test data. A Filter transformation tests data for only one condition Router transformation tests data for one or more conditions when you use a Router transformation in a mapping, the Informatics Server processes the incoming data only once. Comparing Router and Filter Transformations

Creating a Router Transformation


In the Mapping Designer, open a mapping. Choose Transformation-Create

Input values in the router transformation


Select and drag all the desired ports from a transformation to add them to the Router transformation

Edit transformation

Double-click the title bar of the Router transformation to edit transformation properties

Setting properties in the router transformation


Click the Transformation tab and configure transformation properties as desired

port
.

group metadata

properties

Properties tab router transformation


Click the Properties tab and configure tracing levels as desired

Click the Groups tab, and then click the Add button to create a user-defined group

Group tab in router transformation


Click the Group Filter Condition field to open the Expression Editor.

Enter a group filter condition Click Validate to check the syntax of the conditions you entered. Click OK. Connect group output ports to transformations or targets. Choose Repository-Save.

Example of router transformation in mapping

Router Transformation Components

The Types group in Router Transformation

A Router transformation has the following types of groups: Input Output There are two types of output groups: User-defined groups Default group

Using Group Filter Conditions


You create group filter conditions on the Groups tab using the Expression Editor

You can enter any expression that returns a single value. . You can also specify a constant for the condition

You might want to use a Router transformation in a mapping to filter this data to Three different Expression transformations.

There is no group filter condition associated with the default group

Specifying Group Filter Conditions

Group Filter Conditions

Working with Ports

A Router transformation has input ports and output ports . Input ports reside in the input group, and output ports reside in the output . groups. You can create input ports by copying them from another transformation or by manually creating them on the Ports tab.

You can create input ports by copying them from another transformation or by manually creating them on the Ports tab

Port tab in router transformation

Input values in router transformation

Connecting Router Transformations in a Mapping


When you connect transformations to a Router transformation in a mapping, consider the following rules: You can connect one group to one transformation or target.
.

Connect one port to multiple target

You can connect one output port in a group to multiple transformations or targets

Connect multiple out ports to multiple target

You can connect multiple output ports in one group to multiple transformations or targets

Connect more then one group to one target

You cannot connect more than one group to one transformation or target

Lookup Transformation
Use a Lookup transformation in your mapping to look up data in a relational table, view, or synonym Import a lookup definition from any relational database to which both . the Informatica Client and Server can connect You can use multiple Lookup transformations in a mapping. The Informatica Server queries the lookup table based on the lookup ports in the transformation It compares Lookup transformation port values to lookup table column values based on the lookup condition

The task of Lookup transformation


Get a related value. Perform a calculation
.

Update slowly changing dimension tables Connected or unconnected

Cached or uncached

Types of lookup transformation


Connected Lookup Transformation Unconnected Lookups Transformation

Connected Lookup: You can configure a connected Lookup transformation to receive input directly from the mapping pipeline,

unconnected Lookup: To receive input from the result of an expression in another transformation.

Connected lookup transformation


Receives input values directly from the pipeline Cache includes all lookup columns used in the mapping If there is no match for the lookup condition, it returns the default value for all output ports Pass multiple output values to another transformation Supports user-defined default values

Unconnected Lookup
Receives input values from other transformation calling

:LKP expression
You can use a static cache.
.

Cache includes all lookup/output ports in the lookup condition .t If there is no match for the lookup condition, returns null

Pass one output value to another transformation Does not support user-defined default values

Lookup Components
configure a Lookup transformation in a mapping, you have to define the following components:

Lookup table
.

Ports Properties Condition Metadata extensions

Lookup Components

Creating a Lookup Transformation


In the Mapping Designer, choose Transformation-Create.

In the Select Lookup Table dialog box, you can choose the lookup table
Click the Import button if the lookup table is not in the source or target database.

Import lookup transformation


If you want to manually define the lookup transformation, click the Skip button

Define input ports for each Lookup condition you want to define

Import lookup transformation


Lookup transformations that use a dynamic lookup cache, associate an input port or sequence ID with each lookup port. On the Properties tab, set the properties for the lookup. Click OK.

Edit transformation
Double click on lookup transformation edit transformation opens

Setting the properties to port tab

Setting the properties to properties tab

Update Strategy Transformation


For the greatest degree of control over your update strategy, you add Update Strategy transformations to a mapping. The most important feature of this transformation is its update strategy expression, used to

flag individual rows for insert, delete, update, or reject

Update Strategy Transformation


Update Strategy Expressions
Frequently, the update strategy expression uses the IIF or DECODE
function from the transformation language to test each row to see if it meets a particular condition. If it does, you can then assign each row a numeric code to flag it for a particular database operation. For example, the following IIF statement flags a row for reject if the entry date is after the apply date. Otherwise, it flags the row for update:

IIF( ( ENTRY_DATE > APPLY_DATE), DD_REJECT, DD_UPDATE )

Update Strategy Transformation


Lookup and Update Strategy Transformations

When you create a mapping with a Lookup transformation that uses a dynamic lookup cache, you must use Update Strategy transformations to flag the rows for the target tables. When you configure a session using Update Strategy transformations and a dynamic lookup cache, you must define certain session properties.

You must define the Treat Source Rows As option as Data Driven. Specify this option on the Properties tab in the session properties.

You must also define the following update strategy target table options: Select Insert Select Update as Update Do not select Delete

Update Strategy Transformation


These update strategy target table options ensure that the PowerCenter Server updates rows marked for update and inserts rows marked for insert If you do not choose Data Driven, the PowerCenter Server flags all rows for the database operation you specify in the Treat Source Rows As option and does not use the Update Strategy transformations in the mapping to flag the rows. The PowerCenter Server does not insert and update the correct rows. If you do not choose Update as Update, the PowerCenter Server does not correctly update the rows flagged for update in the target table. As a result, the lookup cache and target table might become unsynchronized.

Setting the Update Strategy


When you configure a session, you can select a single database operation for all rows using the Treat Source Rows As setting. Configure the Treat Source Rows As session property:

Setting the Update Strategy


Specifying an Operation for All Rows

Update Strategy Checklist


Update strategy requires setting the right options within a session and possibly adding Update Strategy transformations to a mapping. Only perform inserts into a target table. When you configure the session, select Insert for the Treat Source Rows As session property. Also, make sure that you select the Insert option for all target instances in the session. Delete all rows in a target table. When you configure the session, select Delete for the Treat Source Rows As session property. Also, make sure that you select the Delete option for all target instances in the session.

Update Strategy Checklist


Only perform updates on the contents of a target table. When you configure the session, select Update for the Treat Source Rows As session property. Add an Update Strategy transformation to the mapping. When you write the transformation update strategy expression, use either the DECODE or IIF function to flag rows for different operations (insert, delete, update, or reject). When you configure a session that uses this mapping, select Data Driven for the Treat Source Rows As session property. Make sure that you select the Insert, Delete, or one of the Update options for each target table instance.

You might also like