You are on page 1of 86

INFORMATICA

POWERCENTER 8X DESIGNER

1
Mahindra Satyam 2009 1

Module Objectives
In this module you will learn about The Power Center Designer Components Transformations

2
Mahindra Satyam 2009 2

Designer Overview

Designer has tools to help you build mappings and mapplets so you can specify
how to move and transform data between source and targets

The Designer has the following tools that we use to analyze sources, design
target schemas, and build source-to-target mappings

Source Analyzer Target Designer Transformation Developer Mapplet Designer Mapping Designer

3
Mahindra Satyam 2009 3

Demo: Creating an ODBC DSN

4
Mahindra Satyam 2009 4

Demo: Creating a Source Definition

5
Mahindra Satyam 2009 5

Demo: Creating a Target Definition

6
Mahindra Satyam 2009 6

Designer Overview

7
Mahindra Satyam 2009 7

Designer Components

Navigator Workspace Output Status Bar Overview Instance data Target data

Mahindra Satyam 2009

What is a Transformation?? A transformation is a repository object that generates, modifies, or passes data Transformations in a mapping represent the operations the Informatica Server
performs on the data

Data passes into and out of transformations through ports that are linked in a
mapping or mapplet Ports can be one of the three types:
  

Input data is received Output data is provided Input/Output data passes directly through transformation unchanged

Mahindra Satyam 2009

Designer Transformations
Aggregator Expression Filter Joiner Lookup Rank Sequence Generator Source Qualifier Stored Procedure Update Strategy Router Normalizer

10
Mahindra Satyam 2009 10

Transformation Types

Active  Changes the number of rows passing through it Passive  Do not change the number of rows passing through it Connected  Connected to the transformations in the data flow Unconnected  Not connected to any transformations in the data flow
11

Mahindra Satyam 2009

Types Of Transformation
Active Transformation Passive transformations

Filter Router Update Strategy Aggregator Sorter Rank Joiner Normalizer

Sequence Generator Stored Procedure Expression Lookup

12
Mahindra Satyam 2009 12

Aggregator Transformation The Aggregator is an active transformation The Aggregator transformation allow us to perform aggregate calculations,
such as averages and sums

The Aggregator transformation is unlike the Expression transformation, in


that we can use the Aggregator transformation to perform calculations on groups

The Expression transformation permit us to perform calculations on a rowby-row basis only

We can use conditional clauses to filter rows, providing more flexibility


than SQL language

The Integration Services performs aggregate calculations as it reads, and


stores necessary data group and row data in an aggregate cache

13
Mahindra Satyam 2009 13

Components of Aggregator Transformation


Aggregate expression


Entered in an output port

Group by port


Indicates how to create groups

Sorted input


Used to improve session performance

Aggregate cache


Store group values in a index cache and row data in the data cache
14
14

Mahindra Satyam 2009

Aggregator Transformation

Aggregation Statement

15
Mahindra Satyam 2009 15

Aggregator Transformation
Conditional Clauses


We use conditional clauses in the aggregate expression to reduce the number of rows used in the aggregation The conditional clause can be any clause that evaluates to TRUE or FALSE

Null Values in Aggregate Functions  When we configure the Integration Service, we can choose how we want
the Integration Service to handle null values in aggregate functions

 We can choose to treat null values in aggregate functions as NULL or zero  By default, the Integration Service treats null values as NULL in aggregate
functions

16
Mahindra Satyam 2009 16

Demo : Create an Aggregator Transformation

Mahindra Satyam 2009

17

Expression Transformation
To calculate values in a single row before we write to the target To test conditional statements To perform calculations involving multiple rows, such as sums or averages To perform any non-aggregate calculations

Expression Statement

18
Mahindra Satyam 2009 18

Demo : Create an Expression Transformation

Mahindra Satyam 2009

19

Filter Transformation
Used to filter rows in a Mapping Active transformation Specify a filter condition which returns TRUE or FALSE Records that return TRUE are allowed to pass Filtered records are lost

20
Mahindra Satyam 2009 20

Filter Condition
Filter Condition is entered in the Expression Editor of the Filter transformation The transformation language is used to enter the filter condition expression

Filter Condition

Mahindra Satyam 2009

21

Demo : Create an Filter Transformation

Mahindra Satyam 2009

22

Joiner Transformation
An active transformation Used to join source data from two related heterogeneous sources residing in different locations or file systems We can also join data from the same source Joins sources with at least one matching column Uses a condition that matches one or more pairs of columns between the two sources We can use the following sources with the joiner transformation

     

Two relational tables existing in separate databases Two flat files in potentially different file systems Two different ODBC sources A relational table and an XML source A relational table and a flat file source Two instances of the same XML source

23
Mahindra Satyam 2009 23

Joiner Transformation
Settings for joiner  Master and detail source One of the sources is specified as the master source, and the other as the detail source  Type of join Normal (Default) Master Outer Detail Outer Full Outer
Mahindra Satyam 2009 24

Condition of join

Joiner Transformation Tips

Perform joins in a database when possible Join sorted data when possible For an unsorted Joiner transformation, designate the source with fewer rows as the master source For a sorted Joiner transformation, designate the source with fewer duplicate key values as the master source

25
Mahindra Satyam 2009 25

a2

Demo : Create a Joiner Transformation

Mahindra Satyam 2009

26

Slide 26 a2 I have done the modifications till here


Ajithkumar Menon, 4/10/2008

Lookup Transformation
Used to look up data in a relational table, view, or synonym Passive Transformation We can import a lookup definition from any flat file or relational database to which both the PowerCenter Client and Integration Service can connect The Integration Service queries the lookup source based on the lookup ports in the transformation Can be Connected/Unconnected It compares Lookup transformation port values to lookup source column values based on the lookup condition
Mahindra Satyam 2009 27

27

Lookup Transformation
To configure a Lookup Transformation the following components are defined:

 Lookup table  Ports  Properties  Condition

Mahindra Satyam 2009

28

Lookup Transformation- Lookup Condition

Look up condition

Mahindra Satyam 2009

29

Types of Lookup transformation


The Lookup Transformation can be configured in two ways, Connected and Unconnected, to perform different types of lookups.  Connected  Unconnected

Mahindra Satyam 2009

30

Connected Lookup Transformation


Input values directly from another transformation in the pipeline For each input row, the PowerCenter Server queries the lookup source or cache based on the lookup ports and the condition in the transformation If the transformation is uncached or uses a static cache, the PowerCenter Server returns values from the lookup query If the transformation uses a dynamic cache  It inserts the row into the cache when the row is not found  It updates the row in the cache or leaves it unchanged  It flags the row as insert, update, or no change The PowerCenter Server passes return values from the query to the next transformation

Mahindra Satyam 2009

31

Unconnected Lookup Transformation


An unconnected Lookup transformation receives input values from the result of a :LKP expression in another transformation, such as an Update Strategy transformation The PowerCenter Server queries the lookup source or cache based on the lookup ports and condition in the transformation The PowerCenter Server returns one value into the return port of the Lookup transformation The Lookup transformation passes the return value into the :LKP expression

Mahindra Satyam 2009

32

Connected Vs Unconnected Lookup Transformation


Connected Lookup 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 More visible, shows where the lookup values are used Unconnected Lookup Receives input values from other transformation calling: LKP expression Cache includes all lookup/output ports in the lookup condition 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 Less visible, as the lookup is called from an expression within another transformation
33
Mahindra Satyam 2009 33

Lookup Transformation Tips


Add an index to the columns used in a lookup condition Place conditions with an equality operator (=) first Cache small lookup tables Join tables in the database Use a persistent lookup cache for static lookups Call unconnected Lookup transformations with the :LKP reference qualifier
34
Mahindra Satyam 2009 34

Lookup Caches The Integration Service builds a cache in memory when it processes the
first row of data in a cached Lookup transformation

It allocates memory for the cache based on the amount we configure in the
transformation or session properties

The Integration Service stores condition values in the index cache and
output values in the data cache

The Integration Service queries the cache for each row that enters the
transformation

The Integration Service also creates cache files by default in the


$PMCacheDir
35
Mahindra Satyam 2009 35

Demo : Create a Lookup Transformation

Mahindra Satyam 2009

36

Rank Transformation
Used to select only the top or bottom rank of data Active transformation Generates the Rank Index Grouping can be done

Mahindra Satyam 2009

37

Demo : Creating a Rank Transformation

Mahindra Satyam 2009

38

Sequence Generator Transformation

The Sequence Generator Transformation is used to generate numeric values It is a Passive Transformation It has two predefined output ports  CURRVAL  NEXTVAL The output ports cannot be changed No ports can be added Sequence Generator Transformation can be used to generate numeric values for the following:  Create keys  Replace missing values  Cycle through a sequential range of numbers
39

Mahindra Satyam 2009

Sequence Generator Transformation-Working

The Integration Service generates a value each time a row enters a transformation, even if that value is not used

connected the the

When NEXTVAL is connected to the input port of another transformation, Integration Service generates a sequence of numbers When CURRVAL is connected to the input port of another transformation, Integration Service generates the NEXTVAL value plus one

We might reuse a Sequence Generator when we perform multiple loads to a single target

40
Mahindra Satyam 2009 40

Sequence Generator Transformation

CURRVAL is the NEXTVAL value plus one or NEXTVAL plus the Increment By value. Connecting CURRVAL and NEXTVAL Ports to a Target


We configure the Sequence Generator transformation as follows: Current Value = 1, Increment By = 1


NEXTVAL CURRVAL 2 3 4 5 6

When we run the workflow, the Integration Service generates the following values for NEXTVAL and CURRVAL. If we connect the CURRVAL port without connecting the NEXTVAL port, the Integration Service passes a constant value for each row
41

1 2 3 4 5

41
Mahindra Satyam 2009

Sequence Generator Transformation

Only the CURRVAL Port to a Target




For example, we configure the Sequence Generator transformation as follows

OUTPUT  Current Value = 1, Increment By = 1  When we run the workflow, the Integration Service generates the following constant values for CURRVAL

CURRVAL 1 1 1 1 1

42
Mahindra Satyam 2009 42

Demonstration: Sequence Generator

Mahindra Satyam 2009

43

Source Qualifier Transformation


A Source Qualifier is an active transformation The Source Qualifier represents the rows that the Integration Service reads when it executes a session When we add a relational or a flat file source definition to a mapping source Qualifier transformation automatically comes

44
Mahindra Satyam 2009 44

Source Qualifier Transformation

We can use the Source Qualifier to perform the following tasks


     

Join data originating from the same source database Filter records when the Integration Service reads source data Specify an outer join rather than the default inner join Specify sorted ports Select only distinct values from the source Create a custom query to issue a special SELECT statement for the Integration Service to read source data

45
Mahindra Satyam 2009 45

Source Qualifier Transformation

To view the default query:


  

From the Properties tab, select SQL Query Click Generate SQL Click Cancel to exit

Example of source Qualifier Transformation  We might see all the orders for the month, including order number, order amount, and customer name  The ORDERS table includes the order number and amount of each order, but not the customer name. To include the customer name, we need to join the ORDERS and CUSTOMERS tables.
46
46

Mahindra Satyam 2009

Source Qualifier Transformation

SQL Query:


We can give query in the Source Qualifier transformation.

Joining Source Data:`




We can use one Source Qualifier transformation to join data from multiple relational tables. These tables must be accessible from the same instance or database server

Sorted Ports:


The Integration Service adds the configured number of columns to an ORDER BY clause, starting from the top of the Source Qualifier transformation. The source database sort order must correspond to the session.

47
Mahindra Satyam 2009 47

Demonstration: Source Qualifier

Mahindra Satyam 2009

48

Stored procedure Transformation


A Stored Procedure is a passive transformation A Stored Procedure transformation is an important tool for populating and maintaining databases. Database administrators create stored procedures to automate tasks that are too complicated for standard SQL statements Stored procedures run in either connected or unconnected mode The mode we use depends on what the stored procedure does and how we plan to use it in a session We can configure connected and unconnected Stored Procedure transformations in a mapping

49
Mahindra Satyam 2009 49

Demonstration: Stored Procedure

Mahindra Satyam 2009

50

Update Strategy

An Update Strategy is an active transformation When we design a data warehouse, we need to decide what type of information to store in targets. As part of the target table design, we need to determine whether to maintain all the historic data or just the most recent changes The model we choose determines how we handle changes to existing rows. In PowerCenter, we set the update strategy at two different levels
 

Within a session Within a mapping


Operation Insert Update Delete Reject Constant DD_INSERT DD_UPDATE DD_DELETE DD_REJECT 0 1 2 3 Numeric Value

51
Mahindra Satyam 2009 51

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 )

52
Mahindra Satyam 2009 52

Mahindra Satyam 2009

53

Update Strategy

Setting the Update Strategy

We use the following steps to define an update strategy




To control how rows are flagged for insert, update, delete, or reject within a mapping, add an Update Strategy transformation to the mapping Define how to flag rows when we configure a session We can flag all rows for insert, delete, or update, or we can select the data driven option, where the Integration Service follows instructions coded into Update Strategy transformations within the session mapping Define insert, update, and delete options for each target when we configure a session

 

54
Mahindra Satyam 2009 54

Update Strategy
You can set the following update strategy options:


Insert. Select this option to insert a row into a target table Delete. Select this option to delete a row from a table Update. You have the following options in this situation: Update as Update. Update each row flagged for update if it exists in the target table Update as Insert. Inset each row flagged for update Update else Insert. Update the row if it exists. Otherwise, insert it Truncate table. Select this option to truncate the target table before loading data
55

 

  

55

Mahindra Satyam 2009

Update Strategy in Session Task


Enter an update strategy expression to flag rows as inserts, deletes, updates, or rejects. Setting the Update Strategy for a Session


When we configure a session, we have several options for handling specific database operations, including updates.

Specifying an Operation for All Rows




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

56

Mahindra Satyam 2009

Demonstration: Update Strategy

Mahindra Satyam 2009

57

Router Transformation A Router transformation is an Active Transformation. A Router transformation is similar to a Filter transformation because both transformations allow us to use a condition to test data A Filter transformation tests data for one condition and drops the rows of data that do not meet the condition. However, a Router transformation tests data for one or more conditions and gives us the option to route rows of data that do not meet any of the conditions to a default output group If we need to test the same input data based on multiple conditions, use a Router transformation in a mapping instead of creating multiple Filter transformations to perform the same task

58
Mahindra Satyam 2009 58

Router Transformation
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 we entered. Click OK. Connect group output ports to transformations or targets. Choose Repository-Save

59
Mahindra Satyam 2009 59

Router Transformation
A Router transformation has the following types of groups. Input Output There are two types of output groups. Working with Ports User-defined groups Default group A Router transformation has input ports and output ports. Input ports reside in the input group, and output ports reside in the output groups
Port tab in Router Transformation Router Transformation Components

Mahindra Satyam 2009

We can create input ports by copying them from another transformation or by manually creating them on the
60

60

Router Transformation
Connecting Router Transformations in a Mapping

When we connect transformations to a


Router transformation in a mapping consider the following rules

We can connect one group to one


transformation or target Connect one port to Multiple Target

We can connect one output port in a


group to multiple transformations or targets. Connect Multiple out ports to Multiple Target

We can connect multiple output ports in


one group to multiple transformations or targets.
Mahindra Satyam 2009 61

61

Demonstration: Router

Mahindra Satyam 2009

62

Reusable Transformation
Reusable transformation is a transformation that can be used in multiple
mappings

We can create most transformations as a non-reusable or reusable but only


create the External Procedure transformation as a reusable transformation

When we add a reusable transformation to a mapping, we add an instance of


the transformation. The definition of the transformation still exists outside the mapping Methods To Create Reusable Transformation:

Design it in the Transformation Developer Promote a non-reusable transformation from the Mapping Designer

63
Mahindra Satyam 2009 63

Reusable Transformation
Creating Reusable Transformation

Create in transformation developer Promote an existing transformation to


re-usable Changes that can invalidate mapping

When we delete a port or multiple


ports in a transformation

When we change a port data type, you


make it impossible to map data from that port to another port using an incompatible data type

When we

change a port name, expressions that refer to the port are no longer valid in the reusable transformation, mappings that use the transformation are no longer valid

When we enter an invalid expression


64
64 Mahindra Satyam 2009

Demonstration: Reusable

Mahindra Satyam 2009

65

Working With Flat Files


We can import or create flat file source
definitions in the Source Analyzer or create flat file target definitions in the Target Designer or import flat files lookups or use existing file definitions in a Lookup transformation

When we create a session with a file


source, we specify a source file location different from the location we use , when we import the file source definition

66
Mahindra Satyam 2009 66

Working With Flat Files


Editing a flat file definition: Table tab Edit properties such as table name, business name, and flat file properties.

Columns tab
Edit

column information such as column names, data types, precision, and formats.

Properties tab
We

can edit the default numeric and date time format properties in the Source Analyzer and the Target Designer. can extend the metadata stored in the repository by associating information with repository objects, such as flat file definitions.
67
67

Metadata Extensions tab


We

Mahindra Satyam 2009

Demonstration: Flat Files

Mahindra Satyam 2009

68

User Defined Functions


We can create user-defined functions using the PowerCenter transformation
language

Once you create user-defined functions, we can manage them from the UserDefined Function Browser dialog box. We can also use them as functions in the Expression Editor

We

create a user-defined function in the Transformation Developer. Configure the following information when we create a user-defined function
Name Type Description Arguments Syntax

69
Mahindra Satyam 2009 69

User Defined Functions


Steps to Create User-Defined Functions In the Transformation Developer, click Tools > User-Defined Functions. Click New The Edit User-Defined Function dialog box appears Enter a function name Select a function type If we create a public user-defined function, we cannot change the function to private when we edit the function.

70
Mahindra Satyam 2009 70

User Defined Functions


Optionally, enter a description of the user-defined function. We can enter up to 2,000 characters. Create arguments for the user-defined function. When we create arguments, configure the argument name, data type, precision,
and scale. We can select transformation data types.

Click Launch Editor to create an expression that contains the arguments we


defined.

Click OK The Designer assigns the data type of the data the expression returns. The data
types have the precision and scale of transformation data types.

Click OK The expression displays in the User-Defined Function Browser dialog box.

71
Mahindra Satyam 2009 71

Demonstration: User Defined

Mahindra Satyam 2009

72

Mapplet Designer
A mapplet is a reusable object that we create in the Mapplet Designer. It contains
a set of transformations and mappings we reuse that transformation logic in multiple

When we use a mapplet in a mapping, we use an instance of the mapplet. Like a


reusable transformation, any change made to the mapplet is inherited by all instances of the mapplet Usage of Mapplets

Use multiple source definitions and source qualifiers to provide source data for a
mapping

Accept data from sources in a mapping If we want the mapplet to receive data from the mapping, we use an Input
transformation to receive source data

A mapplet can contain as many transformations as you need We can create a mapplet to feed data to multiple transformations Contain unused ports
Mahindra Satyam 2009 73

73

Mapplet Designer Limitations of Mapplets

We cannot connect a single port in the Input transformation to multiple


transformations in the mapplet

An input transformation must receive data from a single active source A mapplet must contain at least one Input transformation or source definition
with at least one port connected to a transformation in the mapplet and same applies for output transformation

When a mapplet contains a source qualifier that has an override for the default
SQL query, we must connect all of the source qualifier output ports to the next transformation within the mapplet

We cannot include PowerMart 3.5-style LOOKUP functions in a mapplet We cannot include the following objects : Normalizer transformations, Cobol
sources, XML Source Qualifier transformations, XML sources and targets, Preand post- session stored procedures and other mapplets
74
Mahindra Satyam 2009 74

Demonstration: Mapplet

Mahindra Satyam 2009

75

Data Profiling

Data profiling is a technique used to analyze source data PowerCenter Data Profiling can help us to evaluate source data and detect
patterns and exceptions. we can profile source data to suggest candidate keys, detect data patterns and evaluate join criteria

Use Data Profiling to analyze source data in the following situations


`
During mapping development . During production to maintain data quality.

We can create the following types of data profiles


 Auto

profile profile

 Custom

76
Mahindra Satyam 2009 76

Data Profiling

Steps To Create Auto Profile: we can profile the entire source. To create an auto profile. Select the source definition in the Source Analyzer or mapplet in the Mapplet Designer you want to profile. Launch the Profile Wizard from the following Designer tools.

When we create an auto profile, we can profile groups or columns in the source. Or,

77
Mahindra Satyam 2009 77

Data Profiling

We can create a custom profile from the following Designer tools Source Analyzer. Click Sources > Profiling > Create Custom Profile. Mapplet Designer. Click Mapplets > Profiling > Create Custom Profile. Profile Manager. Click Profile > Create Custom.

78
Mahindra Satyam 2009 78

Profile Manager
Profile Manager is a tool that helps to
manage data profiles.

It is used to set default data profile


options, work with data profiles in the repository, run profile sessions, view profile results, and view sources and mapplets with at least one profile defined for them

When we launch the Profile Manager,


we can access profile information for the open folders in the repository.  There are two views in the Profile Manager

Profile View

Profile View Source View


Source View
79
Mahindra Satyam 2009 79

Debugger Overview
We can debug a valid mapping to gain troubleshooting information about data and error conditions.

Debugger is used in the following situations: Before we run a session After we run a session Create breakpoints Configure the Debugger Run the Debugger Monitor the Debugger Modify data and breakpoints

80
Mahindra Satyam 2009 80

Debugger Overview

Create Breakpoints Goto mapping<<debugger<<edit transformations. Choose the instant name, breakpoint type. And then ADD to add the breakpoints. Give the condition for data breakpoint type. Give no. of errors before we want to stop. Run The Debugger Got mapping<debugger<start debugger Click next and then choose the session as create debug session other wise choose existing session Click on next
81
Mahindra Satyam 2009 81

Debugger Overview

Choose

connections of target and source and click next. Click on next Debug Indicators

82
Mahindra Satyam 2009 82

Review Summary

In this module, we covered  Working with PowerCenter 8 Designer

83
Mahindra Satyam 2009 83

Review

Designer is used to create mappings that contain transformation instructions for the Integration Service . (True/False) A Filter Transformation is an -------------------------- Transformation. User-defined functions are not available to other users in a repository.(True/False) Explain briefly about connected and unconnected transformation

84
Mahindra Satyam 2009 84

THE END

85
Mahindra Satyam 2009 85

You might also like