Académique Documents
Professionnel Documents
Culture Documents
PowerMart /
PowerCenter 6 Basics
Document Conventions......................................................................5
Lab Guidelines...................................................................................5
The Design Process...........................................................................7
Lab 1 Create a Folder......................................................................7
Start Repository Manager..........................................................................7
Connect to the Repository.........................................................................7
Create a Folder........................................................................................8
Close the Repository Manager....................................................................9
Lab 2 Analyze Source Data............................................................11
Start the Designer..................................................................................11
Open Folder...........................................................................................11
Open the Source Analyzer........................................................................13
Analyze Source Definitions.......................................................................15
Edit the Source Definition........................................................................17
Create Metadata Extensions.....................................................................18
Clear the Workspace...............................................................................19
Save Work.............................................................................................20
Lab 3 Import Target Schema........................................................21
Open the Warehouse Designer.................................................................21
Import Target Table Definitions................................................................22
Lab 4 Create a Mapping................................................................25
Open Mapping Designer...........................................................................25
Create Mapping......................................................................................26
Add Source and Target Definitions............................................................27
Source Qualifier Transformation...............................................................29
Create an Expression Transformation........................................................30
Modify / Add Ports..................................................................................33
Create Expression Formula......................................................................33
Validate the Mapping...............................................................................37
Lab 5 Create a Workflow...............................................................41
Start Workflow Manager..........................................................................41
Create Workflow.....................................................................................42
Edit the Workflow...................................................................................44
Create Metadata Extensions.....................................................................44
Working with Tasks.................................................................................45
Create Session Task................................................................................46
Edit Session Task....................................................................................47
Link Workflow Tasks...............................................................................50
Validate the Workflow.............................................................................51
Lab 6 Start and Monitor the Workflow..........................................53
Open Workflow.......................................................................................53
Close the Workflow Monitor......................................................................54
Start Workflow.......................................................................................55
LAB GUIDELINES
1
THE DESIGN PROCESS
The first several labs will provide a step-by-step review of the Informatica Design
Process.
O VE R A L L O B J E C T I V E S
O B J E C T I V E S
D U R ATI O N
15 minutes
Select the repository and click the Connect icon in the toolbar.
Create a Folder
A folder is a logical grouping of metadata in the Repository. Folders may group metadata
according to functionality (for example - CRM Group, Financial or Sales), or by individual developer
(for example - Jason, Tracy or Team_1). Creating (and managing) folders is generally handled by an
Informatica Administrator, rather than by individual developers.
A new folder is created and its icon appears in the Navigator window.
2
LAB 2 ANALYZE SOURCE DATA
P U R P O S E
O B J E C T I V E
D U R ATI O N
20 minutes
Connect to Repository
Connect to the same repository in the same manner described under the
flagged step Connect to the Repository on page 9.
Open Folder
Once youve connected to the Repository, there are several ways to open a folder. However,
there is some new terminology that must be explained regarding the differences between an Open
folder and an Expanded folder. What can challenge new developers is that both the Open and
Expanded Folders will appear exactly the same in the Navigator window. The important difference is
what displays (or does not display) in the Workspace to the right.
Open Folder versus Expanded Folder An Open folder is required in order to add, delete or modify
objects. All of the work is performed in the Workspace Window to the right of the Navigator Window
(i.e.- where the tools such as the Source Analyzer, Warehouse Designer, Mapplet Designer, etc., are
active). Once created in the Workspace, all objects will appear in the Navigator Window.
Expanding a folder in the Navigator window does allow you to copy objects from, or create shortcuts
to, another folder that is open. How to copy objects and create shortcuts will be discussed later in this
course.
In order for you to add, delete or change any object in a folder, the folder must be open.
Locate the assigned Studentxx folder and try any one of the following steps:
Highlight the Studentxx folder and click on the open folder icon
in the toolbar
In the Designer, highlight the Studentxx folder and select Tools | Source
Analyzer; or
Click on the first icon on the toolbar just above the Workspace
Workspace
Window
Maximize
icon
Ba
Ba
Open
Folder
drop-down
list
Workspace
(Source
Analyzer
displayed)
Workbook
Tab
Source Definitions
All source data to be read by the Informatica Server must first have its structure (schema) defined to
the PowerCenter Repository. For relational sources, this includes columns, keys, datatypes, precision
and scale (decimals). The process of defining the structure of any source data creates a PowerCenter
Source Definition object. (Defining other types of source data will be covered later in this course.)
Each Source Definition is similar to a parent object, which can be used many times over in the form of
child instances. Each child takes on the characteristics of the parent and when the parent object is
modified, each child instance is updated automatically.
For this lab, the first step in working with PowerCenter objects is to import the table
schema definition for the EMPLOYEE database table.
Select Sources | Import from Database . The Import Tables dialog box appears
In the Select tables box, expand the database Owner name until the TABLES
(node) listing appears.
Expand the TABLES node.
Select the EMPLOYEE table and click on the OK button.
The new source table definition now appears in the Source Analyzer
Workspace.
Source
Definition
Enter
Description
Ba
Metadata Extensions
Metadata may be extended and stored in the repository by creating metadata extensions for repository
objects. The Designer allows the creation of metadata extensions for source definitions, target
definitions, transformations, mappings, and mapplets. Of those objects, Metadata Extensions may be
used to store information that is common across objects of the same type.
Non-reusable Metadata Extensions are unique to each object and will not appear in other objects of
the same type unless they are copies of the original object.
Reusable Metadata Extensions will appear in every object of the same type. For this reason, it
would be important to establish the names of many of these objects to be as generic as possible.
Subsequently, the values entered for the metadata extensions are unique. It is possible to enter fixed
values for each metadata extension; however, the values can be overridden and will be stored
accordingly.
Typically, the Repository Administrator would create Reusable Metadata Extensions to be used by
Developers.
In this example, every Source Definition created will have an author, creation date and potentially, a
last modified date. By creating Metadata Extensions with the names Author, Creation Date and Last
Modified Date, all Source Definition objects will have the same Metadata Extensions by name, but
different values may then be entered for each.
Add Metadata
Extensions icon
Enter: Your
Name and the
current date
Enter your name for the value of Author
Enter the current date [using the syntax = mm/dd/yyyy] for the value of
Creation_Date
Click the OK button to save the new entries to the Source Definition
The object disappears from the Workspace, yet can be found in the assigned
Studentxx folder in the Navigator window (see page 18).
Since the object is still resident in memory and is visible in the assigned Studentxx
folder, the object may be placed, once again, to the Workspace for additional viewing
or editing.
Select the EMPLOYEE Source Definition in the Navigator window
Drag-and-drop the object into the Workspace window
Save
The Designer, unlike the Repository Manager, requires that any changes be manually saved to the
Repository. The key concept to grasp is that folders can only be saved one at a time. In order to
save the contents of a folder, it must be the active folder in the Workspace. The active folder is the
one visible in the Open Folders drop-down list and on the workbook tab (when that view is selected).
If changes were made to objects in other folders and not saved, then those folders (one at time) must
be the active folder in the Workspace to perform the Save Repository command. In addition, if there is
an attempt to close the Designer with unsaved changes to objects, it will notify the end user and
provide an opportunity to save, again, one folder at a time.
Save the work in the Repository to this point by using one of the following methods:
Select Repository | Save; or
Ctrl-s; or
3
LAB 3 IMPORT TARGET SCHEMA
P U R P O S E
O B J E C T I V E
D U R ATI O N
10 minutes
Select any of the Designer tools (at any time) via the Tools
menu or using one of the five icons across the top of the
Workspace, as seen below
Target Definitions
Similar to defining the source in the previous exercise, the target must also be defined and saved to
the repository. For relational target tables, columns, keys, datatypes, precision and scale (decimals)
are included. Indexes may be defined, but are not required. Special cases will be covered later in this
course.
Defining the structure of target data either via importing from the database (schema) or creating it
manually -- creates a PowerCenter Target Definition object.
Import the structure of the ODS_EMPLOYEE table from the database using
Warehouse Designer.
Select Targets | Import from Database
Select the odbc_target ODBC data source connection from the pull-down list
Enter the Username and Password assigned by the Instructor typically
tdbuxx / tdbuxx (where xx is the assigned student number for the
username / password)
Click on Connect
Expand the Targets (node), in the Navigator Window. Notice the addition of
the ODS_EMPLOYEE definition
4
LAB 4 CREATE A MAPPING
P U R P O S E
O B J E C T I V E
D U R ATI O N
20 minutes
Mapping
A mapping represents the dataflow between sources and targets. When the Informatica Server
executes a Session Task within a Workflow (to be discussed later), it uses the instructions configured
in the mapping to read, transform, and write data.
Select the Studentxx folder and open the Mapping Designer by trying one of
the following:
Select Tools | Mapping Designer; or
Click on the last icon on the toolbar just above the Workspace
Recent
Mappings list
Mappings
Node
Normally there are several locations and types of sources, e.g. - databases, flat file, ERP sources, etc.
needed to populate a Data Warehouse. Note in the Sources node the EMPLOYEE Source Definition
is grouped under the name, odbc_source. When the source is imported via an ODBC data source,
the name of the ODBC data source name (DSN) is taken as the database name. The reason for this
is there may be another EMPLOYEE table in another database with a different table structure that
may be needed the name taken from the ODBC DSN makes the Source Definition unique.
If the same source table name, EMPLOYEE, were imported via a different ODBC DSN into the same
folder, the repository wouldnt be able to differentiate between the two. This can potentially cause an
organizational nightmare and will be very confusing to developers. The database name can be
changed while in Edit mode, however, renaming several source definitions is a tedious task.
This scenario will often occur when there are several developers adding sources to the same folder
within the repository. Since ODBC data sources are not shared across workstations, it is vital to select
a naming convention to avoid this problem. Hence, an Informatica Best Practice is for those who are
responsible for importing Source Definitions to synchronize the selected ODBC DSN naming
convention across workstations.
Another way to organize sources, among other select objects, is via the Business Components node
this will be discussed later in the course.
An important point to remember is no matter how source definitions are organized in the repository, it
will not impact how the data is moved from source to target. Refer back to the architecture slides to
see how everything connects. At runtime, the connections (there are several options to discuss) are
handled from the servers perspective, not the client workstations, and will be discussed in greater
detail when the Workflow Manager is covered.
Notice the object called SQ_EMPLOYEE in the mapping above. This transformation object is called
the Source Qualifier and is required for all relational and flat file sources. It was created automatically
when an instance of the Source Definition EMPLOYEE was added to the mapping.
The Source Qualifier is the interpreter for the PowerCenter engine. This is where the file or table
read is defined. For relational sources, the Source Qualifier will deliver the SQL (dynamically or via
SQL overrides) to the Informatica Server at runtime, for execution according to database type. In turn,
the database type dictates or interprets the respective native data types that will be delivered to the
database engine for extraction.
As this course continues, there will be several other attributes of the Source Qualifier to explore and
other types of PowerCenter source interpreters will be introduced.
Ports
Notice the name of the first column, Port Name. Port is the generic Informatica term used for both
table columns and flat file fields.
There are two types of transformations: Passive and Active. Passive transformations allow every
row of data to pass through it so if 100 rows go in, then 100 rows will go out to the next
transformation. Active transformations may decrease or increase the number of rows passing
through.
As each transformation object is introduced during the course, it will be labeled as either passive or
active. There are internal validation checks to make sure transformations can be linked together based
on this very concept.
Look for the arrow icon just to the right of a set up vertical bars
Single-click on the double vertical bars and drag to the center of the
Workspace
Another suggested location is right below the default location of the Standard
Toolbar to move it, drag and drop from the title bar
Drag the pointer, which now appears as crosshairs , into the Workspace
window to the right of the Source Qualifier transformation
Single-click (or, click-and-drag, which will draw a box, then release)
Set the Mapping Designer to copy port names and create link relationships
between transformation objects:
Link the following ports from the sq_EMPLOYEE to the new Expression
transformation:
Click on the Add icon to add a new port and rename it, NAME_out
Add Port
icon
New Port,
output-only
Click in the Expression column of the NAME_out port and notice the arrow
that appears at the far right
Formula
Undo icon
Formula
Window
Individual
Port Details
Completed
Expression
Formula
The mapping is now complete and should look like the following:
Ctrl-s to save
Mapping Validation
All mappings must pass a set of PowerCenter validation checks before executing it within a Session
Task.
Every time a repository save is executed, a series of validation checks are performed on what has
been changed. If a transformation object is changed within a mapping or mapplet, the object will be
checked and then mapping validation checks will occur.
Since development is iterative, it may be necessary to leave a mapping in an invalid state. All
mappings that are invalid will have a red x icon just to the left of the mapping name in the
Navigator Window.
The Mappings | Validate menu command is a manual validation check that can be performed on
mappings that are active in the Workspace.
View the results of the Validation by locating the Save tab of the Output
window, at the bottom of Designer
Output
Windows
Save Tab
Save Time
Stamp
First Error
Mapping
declared
Invalid
Fix the first error and save or perform the Mappings | Validate
command from the main menu (Note the results will be
located in the Output windows Validate tab).
Validation
Time
Stamp
No Errors
Mapping
declared
Valid
Validate
Tab
5
LAB 5 CREATE A WORKFLOW
P U R P O S E
This lab provides instructions to create a simple Workflow with a Start Task
and Session Task. Collectively, the goal of creating these objects is
essentially to define a run-time version of the mapping created in the
previous lab
O B J E C T I V E
D U R ATI O N
30 minutes
Connect to Repository
Connect to the same repository in the same manner described under the
flagged step Connect to the Repository on page 9
Open Folder
Locate the assigned Studentxx folder and try any one of the following steps:
Highlight the folder and click on the open folder icon in the
toolbar;
A workflow is a set of instructions that tells the Informatica Server how to execute tasks such as
sessions, email notifications, and shell commands. After tasks are created in the Task Developer and
Workflow Designer, tasks are connected via links to create a workflow.
In the Workflow Designer, conditional links and workflow variables are used to create branches in the
workflow. The Workflow Manager also provides Event-Wait and Event-Raise tasks. The sequence of
task execution can be controlled in the workflow. Worklets (a group of tasks) can be created and
inserted inside the workflow.
Every workflow contains a Start task, which represents the beginning of the workflow.
Workflow Log
File Name
Workflow Log
Directory
The workflow log contains basic information (execution start and completion times, status, etc.)
for all tasks in the workflow. It is optional and if left blank (default) the Informatica Server writes
workflow log messages to the Windows Event Log or UNIX server log.
If a log file name is entered, the workflow log messages will be redirected to the designated file name
within the Workflow Log File directory on the Informatica Server.
Enter the current date for the value of Creation_Date [using the syntax as
before = mm/dd/yyyy]
Enter your name for the value of Workflow_Author
Click on OK, to both apply the entries and exit the Workflow
Save the new entries to the Repository, select Repository | Save, OR Ctrl-s.
Session Tasks
Session tasks represent mappings for the Informatica Server to run. The Informatica Server uses the
instructions configured in the session to move data from sources to targets. Among its many
properties are parameters for memory usage, log file locations, and source and target read/write
instructions. Each session task is associated with one, and only one, mapping; however, one mapping
may be used in several session tasks.
Session Log
Directory
Click on the down arrow on the right side of the Value column for the
sq_EMPLOYEE listed in the Instance column
Source Native
Database
Connection
Click on the down arrow on the right side of the Value column for the
ODS_EMPLOYEE Target Instance
Select native_target_xx (where xx represents the assigned student
number from 01-12) and click OK
Only if the target table database connection is using an Oracle client
less than 8.1.7.2 select the Properties tab at the bottom and select
Normal for Target load type
Toggle off the link mode by clicking again on the Link icon or single click
on one of the objects
Save
Validating a Workflow
Similar to the mapping, a workflow must pass all validation checks prior to running it. For example, if a
workflow is created with a Start Task and a Session Task and the two are not linked, the workflow is
invalid.
The Output window in Workflow Manager displays the results of the validation checks and will point
out specifically what (not how) needs to be fixed.
Output
Windows
Save Tab
Fix the first error and save or perform the Workflow | Standard
validate command from the main menu (Note the results will
be located in the Output windows Validate tab).
This lesson provides instructions to start the workflow and monitor the
process with the Workflow Monitor.
O B J E C T I V E
D U R ATI O N
40 minutes
Open Workflow
There are two ways to re-open a workflow. To demonstrate both methods, the
Workspace must be clear of any workflows:
Select Workflows | Close if the menu item to Close is grayed out, then there are
no open workflows
Informatica PowerMart / PowerCenter 6 Basics Lab 6 Start and Monitor the Workflow 55
Drag-and-drop the wf_ODS_EMPLOYEE_xx Workflow from the Navigator
Window into the Workspace
Recent
Workflows
List
Informatica PowerMart / PowerCenter 6 Basics Lab 6 Start and Monitor the Workflow 56
Start Workflow
If the workflow is valid, it is ready for execution. In the Workflow Designer, use one
of the following methods to start the wf_ODS_EMPLOYEE_xx Workflow:
Select Workflows | Start workflow; or
Right-
click on the start_ODS_EMPLOYEE
task in the wf_ODS_EMPLOYEE_xx
Workflow. Select Start Workflow from
Task menu option
Starts a single
Task only
Informatica PowerMart / PowerCenter 6 Basics Lab 6 Start and Monitor the Workflow 57
Any of the above options would show the following dialog box:
There is a difference between the Workflow Monitor program being initialized and open. For
example, a virus protection program may be initialized and operating in the background (to actively
protect the computer), without a client tool appearing as an active program visible on the Desktop. It
will be present in the form of a minimized icon on the Windows Taskbar. However, all functional
settings cannot be accessed until the program is opened.
Such is the case with Workflow Monitor. Once initialized, it may then be opened by the user without
ever accessing the Windows Start menu. Starting the Workflow, wf_ODS_EMPLOYEE_xx from
the Workflow Manager automatically initialized the Workflow Monitor. This is a convenient feature that
is enabled by default and cannot be turned off.
Informatica PowerMart / PowerCenter 6 Basics Lab 6 Start and Monitor the Workflow 58
How quickly the Workflow Monitor initializes depends on the
speed of network between the Informatica Server and
PowerCenter client. A remote connection from the client to
the server will likely cause a delay and take a few seconds
up to a minute.
To open Workflow Monitor from the minimized taskbar icon, try one of the following
methods:
Right-click on it and select Open; or
Double-click on it
Gantt Chart
Navigator Time
window window
(area) (area)
Task View
Navigator Time
window window
Informatica PowerMart / PowerCenter 6 Basics Lab 6 Start and Monitor the Workflow 59
If the Workflow Monitor does not resemble the above,
either the Gantt Chart or Task View, then notify the Instructor before
proceeding. The Workflow Monitor needs to be completely disconnected
to continue with the instructions going forward.
Any of these methods will produce the Connect to Repository dialog box:
Repository
Select List
Connect to
Repository
Informatica PowerMart / PowerCenter 6 Basics Lab 6 Start and Monitor the Workflow 60
Accept the default or enter the assigned Repository studentxx Username and
then the Password
In the Repository Server box, if there is no default entry, enter the Host Name
and Port Number designated by the Instructor
Click on the Connect button. The PC_Course Repository shows in the
Navigator window. Notice that the disconnect icon and the PC_Server
server is displayed; both are signs that the user is connected to the
repository
In On Line mode, the Workflow Monitor continuously receives current information from the
Informatica Server via the Repository Server (e.g. Workflow development testing). With Off Line
mode, the Workflow Monitor displays historic information about past Workflow and Task runs by
retrieving the information from the Repository (e.g. Production run review).
Both Developers and Production Operators will use the Workflow Monitor for Workflow and Task
processing on the Informatica PowerCenter Server. Developers, typically, will be in On Line Mode to
monitor current activities. They may also act as Production Operators while testing and use it in Off
Line Mode to review the previous test runs; Production Operators, of course, will monitor production
runs.
Informatica PowerMart / PowerCenter 6 Basics Lab 6 Start and Monitor the Workflow 61
Drill down (double-click on each object) all the way until the session task,
s_m_ODS_EMPLOYEE_xx, appears
Workflow Monitor provides the capability to review server-processing information. For each
Session task (the most common), information about rows loaded or failed and run status. In addition,
there are two primary types of views, Gantt Chart and Task View.
Task
Name
(icons)
Task
View tab
Three objects should appear in the selected folder. Note the run time for each is
within seconds of each other:
The s_m_ODS_EMPLOYEE_xx Session Task -- icon
Informatica PowerMart / PowerCenter 6 Basics Lab 6 Start and Monitor the Workflow 62
The start_ODS_EMPLOYEE Task -- icon
The wf_ODS_EMPLOYEE_xx Workflow -- icon
The Workflow Monitor displays Start and End times relative to the time configured on the Informatica
Server machine. The PowerCenter client machine interpolates and displays the actual Server run
times to the local client time zone. Since the monitoring activity can take place on multiple clients, in
multiple time zones, each client will convert the Server time to its local time, e.g. if the Server runs a
Session at 12:00pm EST, a client in EST will display 12:00pm; a client in PST will display the times 3
hours earlier (9:00am); a client in GMT will display the times 6 hours later (6:00pm) than EST.
Notice the Status column on the right. The objective is to have all of the tasks show
Succeeded. Below, they are grouped together in a view.
A Succeeded status will display if the Informatica PowerCenter Server was able to successfully
complete a workflow or task. However, a Session Task may succeed in processing, but may still
contain warnings or non-fatal errors.
A Failed status may occur if the Informatica Server failed the Workflow or Task due to fatal processing
errors. A Session could fail for many reasons (e.g. - read login failure, custom SELECT statement
error, or the Server was not able to calculate data due to a NULL condition). A rejected row by the
database or discarded by a business rule will not produce a Failed status.
Informatica PowerMart / PowerCenter 6 Basics Lab 6 Start and Monitor the Workflow 63
View the Session Properties by doing any one of the following:
Right-click anywhere on the line selected and select Properties; or
The Properties tab of the s_m_ODS_EMPLOYEE_xx dialog box opens. The Session
should display the number of Target Success Rows shown below:
Properties
Tab
Expected
Results
Click on the Transformation Statistics tab. More detail on the number of rows
handled by the Server are shown here:
Informatica PowerMart / PowerCenter 6 Basics Lab 6 Start and Monitor the Workflow 64
Target
Instance
Transformation
Statistics Tab
Source
Qualifier
Instance
Applied rows are rows the Informatica Server successfully produced and applied to the target without
errors.
Affected rows are generated by the Server and affected to (or accepted by) the target. They may be
a combination of INSERT, UPDATE and DELETE rows, or multiple rows in a database may be
impacted by one UPDATE row.
Rejected rows are either those read rows that either the Server dropped during the transformation
process, or rows that rejected when writing to the target. Rejected rows may be acceptable and
expected.
Informatica PowerMart / PowerCenter 6 Basics Lab 6 Start and Monitor the Workflow 65
Right-click on Session in the Task Name column (Time window) and select Get
Session Log; or
Select the Session anywhere on the line in the Time Window and click on
If errors have occurred, review the Session log to determine what errors occurred.
Test and rerun as necessary.
Processing)
Memory
(DTM Buffer
Pool)
Mapping
Name
Session
Name
Native Source
and Target
INSERT, UPDATE Database
and DELETE row Connections
syntax (if created)
Session
Processing
Threads
Informatica PowerMart / PowerCenter 6 Basics Lab 6 Start and Monitor the Workflow 66
Lab
This is an Instructor-led follow along lesson to show and explain the various
Designer features and techniques that can improve efficiency and ease of use.
Because these features are introduced together, under the guidance of the Instructor,
they do not need to be haphazardly squeezed into the labs. They can be used, when
needed, in the subsequent labs.
It is recommended not to save any changes at the conclusion of this exercise because
it may invalidate the mapping.
The following is a list of the more commonly used features and techniques in the
Designer tool to assist with mapping development and navigation in the workspace:
Auto Arrange
Remove Links
Manual Linking
Revert to Saved
Link Path
Autolink by name and position
Moving Ports
Shortcut from Normal View to Edit Port
Copy Columns versus Link Columns
Create Transformation Methods
Zoom and size-to-fit
Designer Options
D U R ATI O N
40 minutes
Connect to Repository
Connect to the PC_Course Repository (refer to flagged step Connect to
the Repository on page 9)
Open Mapping
The Designer includes the Arrange feature that will reorganize objects in the
workspace in one simple step. This aids in readability and analysis of the mapping
flow and can be applied to certain paths through a mapping associated with specific
target definitions this is commonly referred to as a pipeline.
Attempt to Save
In a couple of clicks, this feature can take a mapping that looks like this:
Click OK
To restore entire mapping from Iconic View to Normal View, do the following:
Click-and-drag the pointer over the blue link lines, only, between the
exp_ODS_EMPLOYEE and the ODS_EMPLOYEE Target Definition
Press the Delete key to remove the connections and make sure that is all that
is deleted
This lesson is to demonstrate the proper technique to manually link ports between
transformations
Single-click and hold the left mouse button in the white space just to the
right of the text for the NAME_out port in the exp_ODS_EMPLOYEE
Expression and attempt to link it to the NAME port in the ODS_EMPLOYEE
Target Definition
Make another attempt to create the same link; however, this time, Single-
click on text rather than the white space
While editing an object in the Designer, if unwanted changes are made there is a way to revert to a
previously saved version undoing the changes since the last save. This works for one
transformation object or several depending on the tool. The Revert to Saved feature works with the
following objects: Sources; Targets; Transformations; Mapplets and Mappings.
Tracing link paths allows the developer to highlight the path of a port either forward or backward
through an entire mapping or mapplet.
To make sure all students are on the same page, Revert to Saved
Right-click on EMPLOYEE_ID in the sq_EMPLOYEE Source Qualifier
sq_EMPLOYEE and Select Link Path | Forward
Autolink by name
Developers can automatically link ports by name in the Designer. Use any of the
following options to automatically link by name:
Link by name
Link by name and prefix
Link by name and suffix
The Designer adds links between input and output ports that have the same name.
Linking by name is case insensitive. Link by name when using the same port names
across transformations.
By Name
Using the drop down list, only one transformation may be selected in the From
Transformation box and one to many transformations may be selected in the To
Transformations section. For objects that contain groups such as Router
transformations or XML targets, select the group name from the To Transformations list.
Click OK
When Autolinking by name, the Designer adds links between ports that have the same name,
case insensitive. The Designer also has the ability to link ports based on prefixes or suffixes
defined. Adding Suffixes and/or Prefixes in Port Names help identify the ports purpose. For example,
a suggested best practice is to use the suffix _out when the port is derived from input ports that were
modified as it passes through the transformation. Without this feature, Autolink would skip over the
names that dont match and force the developer to manually link the desired ports.
Autolink by Position
The Autolink by position links the first output port to the first input port, the second output port
to the second input port, and so forth. Use this option when creating transformations with related ports
when applicable in the same order.
By Position
Click OK. The Designer links the first output port to the first input port, the
second output port to the second input port, and so forth.
There are a couple of ways to move ports around within a transformation. Moving ports around
in a transformation may be required to see which ports are needed for a calculation, or to group them
(discussed later), or to simply line them up with how the Target looks to see the flow of the mapping
easier.
While still holding the left mouse button, position the pointer just below the
TYPE_CODE port until a red-line appears under it
There is a shortcut to go from the Normal View directly to the port desired in the Edit View this
is especially useful in transformation objects that have dozens of ports.
In the Mapping Designer, copying ports from one transformation to another is a valuable time
saver. In lieu of entering the ports manually which includes the name, data type, precision and scale,
the drag-and-drop method can be used by the developer to create a port in the desired
transformation.
The Designer includes a toggle feature to switch between Copy Columns and Link Columns.
With Copy Columns, a port may be dragged and dropped from one transformation to another,
capturing the integrity of the Name, Datatype, Precision and Scale. With Link Columns, if the desired
port does not exist in the transformation to be linked, it will copy and link the port. If the port does
exist, the port can simply be linked. In order for the link to be established between transformations, it
must pass a validation check the Designer performs automatically. If the validation check does not
pass, the port will be copied, only, and not linked. If only attempting to link ports the link will drop the
message can be found in the status bar at the bottom of the window.
Copy columns
Use the mouse to choose the copy columns icon
Use the mouse to choose the link columns icon Link columns
Maneuver the transformations and adjust their sizes to all of the ports
Link Columns
Choose the link columns by selecting Layout | Link Columns or the Link
Columns icon
Link the TYPE_CODE port from sq_EMPLOYEE Source Qualifier to the
exp_ODS_EMPLOYEE Expression
can just link ports and copy / link ports as will be demonstrated
here.
Mapplet Designer. Create and configure a set of transformations, called mapplets that
Developers can use in multiple mappings
There are two ways to create transformations from scratch. There is the Transformation Toolbar that
includes every Informatica transformation and then there is the menu option, Transformation | Create.
When using the transformation toolbar developers will be able to click and drop transformations to a
desired location in the workspace and it will also give it a default name. The Transformation | Create
option forces the developer to select the desired transformation from a drop down list and the name
must be typed in before the Designer creates the transformation.
Pick a location where the transformation should appear and single-click again
A mapping may be difficult to view in the workspace and the developer may want to change the
magnification to see it better. Below are the features and techniques to adjust the magnification.
Scale to fit
Scale to Fit
Zoom Center
Zoom Point
Zoom Rectangle
Zoom Normal
8
LAB 8 THE DEBUGGER
P U R P O S E
O B J E C T I V E S
D U R ATI O N
20 minutes
Prepare Designer
These first steps will be to setup the Mapping Designer. Some of the steps may not
be necessary because the Designer may still be open from the previous exercise.
Clear Workspace
Close Mapping
A good practice to set up for any new development assignment (in this case, a lab) is
to close the previously opened mapping.
Locate the Recent Mapping list immediately above the Mapping Designer
Workspace. If the mapping name is present in the Recent Mappings drop-
down list, then it is still open. If not, skip to the Copy Mapping Step
This tab
should
not be
visible
Continue to drill down to the Mappings node in the same fashion as the
folder and select the m_ODS_EMPLOYEE_BAD mapping
Paste the mapping by selecting the assigned Studentxx folder and doing one
of the following:
Select Edit | Paste; or
Ctrl-V
Click and hold the Ctrl key and note the copy icon
while in the Workspace
Drop the mapping
After selecting Yes to confirm the copy, two more decision dialog boxes
appear. Select Reuse for both:
And
Collapse the Shared_Student folder (click on the - to the left of the folder
name in the Navigator window)
Save
Open Mapping
In order to run the Debugger, the mapping to be debugged must be open in the
Mapping Designer. It may already be open based on how it was copied into the
assigned Studentxx folder from the previous step. Check for the name
m_ODS_EMPLOYEE_BAD in the recent mapping list:
Edit Mapping
Change the name of the m_ODS_EMPLOYEE_BAD mapping to include the student
assigned number to keep it unique consequently it will have a unique session name
and session log by default.
Select Mappings | Edit. The Edit Mappings dialog box opens
Arrange Mapping
Right-click in the Workspace
Select Arrange.
Start Debugger
Start the Debugger by doing one of the following:
Server Select
List
Instruct the
Debugger
Server to
Create a Debug
Session
Leave PC_Server as the Server to use for the debug Session the default
Server displayed on the pull-down list
On the last page of the Wizard (not shown), leave the check in the Discard
target data checkbox.
This option will take the data to the database to check for
errors, but will not commit the rows
Rotate position of
the Instance
windows if desired
via drag and drop
method
Click on the Session Log tab to watch the Real-Time log creation
The Debugger toolbar will come become active when in debug mode.
Once a starting point (transformation) for the debug process is selected, the Next Instance icon
allows the user to follow a row through each transformation in the mapping. The Debugger will then
proceed to the next row and follow it through each transformation.
Think of the two squares in the Next Instance icon as representing transformations, and a row
stepping from one transformation to the next.
The Step to Instance icon allows the user to examine one transformation at a time, following one-
row-after-another through the same transformation.
Think of the picture in the Step to Instance icon representing steps as if stepping down to the
next row, in the same transformation.
Click on the Next Instance icon (or F10) to start the movement row
through the Debugger
The smaller green arrow displaying a flashing yellow on the bottom of the
Source Qualifier will continue to flash as long as rows are being read
Continue to press F10 and notice the focus of the debug change as row-by-
row, each row moves from the sq_EMPLOYEE to the exp_ODS_EMPLOYEE
Examine the data in the Instance window and notice the pull-down list can be
used to see a row in either of the two transformations in the mapping
Try the Step to Instance (Ctrl-F10) and watch each row through one
transformation
Compare the data from one transformation to the next and determine where
the mapping errors are
Click on the Stop the Debugger icon. The Designer will ask for
confirmation:
Click on Yes. The Debugger Server will shutdown and return to the normal
Mapping Designer Workspace
Debugger Breakpoints
Restart Debugger using exactly the same selections all the way to
initialization (refer to the flagged steps Start Debugger on page 99)
Click on the Add a new column to this table icon in the Condition section
in the middle of the dialog box
Select <<ANY-PORT>> in the Ports Drop down list
Select ISNULL as the Operator
The Debugger will run through all of the rows until the
first occurrence of a NULL is present. Note that two rows pass to the
Target and then stops. With the sq_EMPLOYEE as the Instance, note
the TYPE_CODE is NULL there is a check in the NULL checkbox on the
left.
Click the Continue button, yet again for a final time, and the Debugger stops
Edit the Breakpoints
Load a Time ODS Table. This table will contain filtered time data based on an
Instructor-defined date
O B J E C T I V E
Perform Source Analysis of a Flat File using the Flat File Wizard
Learn to use the Filter Transformation
D U R ATI O N
30 minutes
S U M M A R Y
Wherever a source flat file is located (Windows or UNIX) its definition must be imported into the
repository via the Source Analyzer in the Designer tool.
The definition for Flat Files may be imported into the Repository from local, mapped, or NFS mounted
drives. If a flat file is on UNIX, then it is suggested to copy it via FTP to either a local or mapped drive
(Windows-based operating system). When the Session Task in the Workflow runs, the file will be read
from the UNIX directory in which it is physically located.
Once the file definition is in the repository, it can be discarded from the local or mapped drive because
the Informatica PowerCenter Server will not look to client workstation for location information. When
running a Session Task, always think about the location of the file from the Informatica PowerCenter
Servers perspective never from the client workstation.
Informatica PowerMart / PowerCenter 6 Basics Lesson 9 Flat File Wizard and Filter 109
Change the Files of type: to All Files (*.*), locate the directory (Instructor
will provide location, and import the Flat File, TIME.txt.
Select Delimited
Click on Import Field Names From First Line
Import field
names from first
line
The first row in the TIME.txt flat file contains the column
names. When the option is checked, it automatically starts the import at
row 2 and assumes that future extracts will start at row 2. This, of
course, can be changed if necessary without using the wizard (e.g. If the
Informatica PowerMart / PowerCenter 6 Basics Lesson 9 Flat File Wizard and Filter 110
first extract contained column names which is helpful to the developers
who need to know but future extracts do not, then this can be changed
back to import from the 1st row.)
Click Next
Make sure that Comma is set under the Delimiters section and the text Qualifier
should be set to Double Quotes
Click Next
By importing the field names from the first line (Step 1), the port names have
already been created. No other modifications are necessary
Informatica PowerMart / PowerCenter 6 Basics Lesson 9 Flat File Wizard and Filter 111
The Wizard takes a best guess at the Datatype, length
and width based on the first 500 rows.
Click Finish
Informatica PowerMart / PowerCenter 6 Basics Lesson 9 Flat File Wizard and Filter 112
Import Target Table
Create Mapping
Create a new mapping called m_ODS_TIME_xx (refer to the flagged step
Create the Mapping on page 28)
Informatica PowerMart / PowerCenter 6 Basics Lesson 9 Flat File Wizard and Filter 113
Create Expression Transformation
Going forward, when there is a picture below a Step Title (e.g. Create Expression
Transformation), it reflects how the object should appear upon completion of the step. When
transformations are linked, it will show the previous transformation and which columns are linked,
input/output ports, etc. The bullets provide the details necessary to complete the entire step.
Furthermore, the learning process should be in full swing and the steps will become more vague
expecting that tasks have been learned. As the instructor stated, the rule of thumb is the first time
step has been introduced in detail, the second time there is reference back to it and finally, the third
time and beyond it is expected to have been learned.
Select all ports within the sq_TIME transformation, then drag-and-drop the
cursor to the Expression Transformation just created
Informatica PowerMart / PowerCenter 6 Basics Lesson 9 Flat File Wizard and Filter 114
Highlight the third port, Quarter, then add the following ports, each by
clicking the Add Port button
An expression will be needed for each of the above ports. Open the expression editor
and add expressions for each port as follows (See flagged step Create an
Expression on page 35).
PORT FORMULA
DATE_ID TO_DATE(DATE,DD-MON-YYYY)
MONTH_out SUBSTR(DATE,4,3)
QUARTER_out SUBSTR(QUARTER,6,1)
YEAR_out SUBSTR(QUARTER,1,4)
Informatica PowerMart / PowerCenter 6 Basics Lesson 9 Flat File Wizard and Filter 115
Create Filter Transformation
Drag the pointer, which now appears as crosshairs , into the Workspace
window to the right of the exp_ODS_TIME Expression
Single-click (or, click-and-drag, which will draw a box, then release)
Drag and drop the following ports from exp_ODS_TIME to the FILTRANS
window:
DATE_ID
DAY_OF_WEEK
MONTH_out
QUARTER_out
YEAR_out
Double-click on the Filter Transformation
Under the Transformation tab click the Rename button and enter fil_ODS_TIME
Click on the Ports tab and remove the _out from each of the three ports
(before = aft):
MONTH_out = MONTH
QUARTER_out = QUARTER
YEAR_out = YEAR
Click on the Properties tab
Informatica PowerMart / PowerCenter 6 Basics Lesson 9 Flat File Wizard and Filter 116
Click on the arrow on line 1 (Filter Condition) to the far right in the Value
column to open the Expression Editor
Click here to open
Expression Editor
To specify the Filter Condition, highlight TRUE and then press the delete key to
remove the default condition
Click on the Ports Tab in the Navigator Window
Double-click on DATE_ID under the fil_ODS_TIME transformation
Use the Autolink by Name or Position feature to link the transformation objects.
Select fil_ODS_TIME for the From Transformation and ODS_TIME for the To
Transformations. Click OK. All ports should be linked between these two
transformations (shown above)
Validate the mapping by selecting Mapping |Validate
Save
Completed Mapping
Informatica PowerMart / PowerCenter 6 Basics Lesson 9 Flat File Wizard and Filter 117
Create Workflow
Complete the following steps (refer to Start Workflow Manager on page 43)
Start Workflow Manager
Connect to Repository
Open Folder
Informatica PowerMart / PowerCenter 6 Basics Lesson 9 Flat File Wizard and Filter 118
Monitor and Review the results for s_m_ODS_TIME_xx in the Workflow
Monitor
Expected
Results
Informatica PowerMart / PowerCenter 6 Basics Lesson 9 Flat File Wizard and Filter 119
The above dialog box is similar to the ones used to connect to the source and target
database. In this case the connection needs to be made to the target database.
Login to the target database in the same manner; refer to the flagged step Analyze
Source Definitions on page 17.
Select the odbc_target ODBC data source connection from the pull-down list
Enter the Username and Password assigned by the Instructor should be
tdbuxx / tdbuxx (username / password)
Click on Connect and the results appear in the bottom half of the dialog box.
The default number of returned rows is 100, however, for the exercises going
forward, only the first few rows will be shown in the Results sections.
Informatica PowerMart / PowerCenter 6 Basics Lesson 9 Flat File Wizard and Filter 120
Informatica PowerMart / PowerCenter 6 Basics Lesson 9 Flat File Wizard and Filter 121
Lab
The purpose of this lab is to populate a fact table by joining a flat file and a
relational table. The flat file has orders to vendors data for products and
supplies. The product table has data on the make and model name, the
vendor that supplies the product, and the cost. We want to load an ODS table
with the costs summarized by date, product and vendor. This will be the raw
data that will be used to populate the fact table.
O B J E C T I V E
D U R ATI O N
35 minutes
S U M M A R Y
Import Target
Clear Warehouse Designer Workspace (Right-click anywhere in the Workspace
and select Clear All)
Import the relational database target, ODS_ORDER_AMOUNT
Save Repository
Create Mapping
Create a mapping called m_ODS_ORDER_AMOUNT_xx
Add both order and product source definitions with their respective Source
Qualifiers
Navigator Output
Window Window
Toggle Button Toggle Button
The Joiner Transformation can only join two disparate (heterogeneous) sources. If three or
more heterogeneous sources are needed to complete the mapping, then multiple Joiner
transformations will be needed and they will be nested the results from one Joiner will be passed
on to the next and so forth. In addition, the Joiner needs a minimum of two ports, one from each
source to create a join condition. Those two ports must be compatible data types and length to for the
join condition to be successful.
One of the two sources in each Joiner must be deemed the Master and the other, by default, will
become the Detail. The Master is designated by the M port attribute, and is essentially cached to
memory. If not enough memory is allocated on the Properties tab (discussed later in the course) then
the spillover will cache to disk and ultimately degrade performance. To determine which source should
be the Master, it is recommended to choose the smaller (total bytes; not necessarily rows) of the two
since it will take less time and use less system resources to cache. To calculate which source will
cache less between the two, factor in the number of ports, their respective data types, precision and
scale and THEN, multiply that by the expected number of rows.
The Aggregator transformation allows aggregate calculations, such as averages and sums. The
Aggregator transformation is unlike the Expression transformation, in that it can be used to perform
calculations on groups. The Expression transformation permits calculations on a row-by-row basis
only.
SUM(QUANTITY_in)
Save the mapping and check for validation information on the Save tab in the
output area. If valid, proceed to the Workflow Manager.
Create Workflow
11
LAB 11 SORTER
P U R P O S E
The purpose of this lab is to populate an ODS table by joining a flat file and a
relational table. Its the same table as the previous lab, however, assuming
there is a large amount of data broken down into several groups, the data will
flow through the mapping much faster through the Aggregator if the data is
sorted. Since the data is not coming, solely, from a relational source,
grouping the data in the Source Qualifier will serve very little purpose. The
addition of the Sorter Transformation and a property in the Aggregator has
the potential to significantly enhance performance.
O B J E C T I V E
D U R ATI O N
20 minutes
S U M M A R Y
Copy Mapping
The first step will be to copy the previous mapping
Save
Remove Links
Remove all input links to agg_ODS_ORDER_AMOUNT
Add Links
Since the Sorter Transformation sorts the data, the Aggregator has a property to keep the data
flowing called Sorted Input. It makes no difference if the database does the sorting or the Sorter
Transformation, however if the property is checked the, Aggregator expects the data to be sorted.
How this property keeps the data flowing is after the last row of a particular group (defined by the
Aggregator GroupBy checkboxes) enters its respective memory cache, the aggregation for that group
begins and a new memory cache is created for the next group and so on. Without this property, each
and every row would have to enter the memory cache before aggregation would occur. This
potentially could produce a very large bottleneck.
Create Workflow
12
LAB 12 BASIC LOOKUP
P U R P O S E
To load an ODS table with only those customers who have one or more
completed, non-cancelled, invoices on record
O B J E C T I V E
D U R ATI O N
40 minutes
S U M M A R Y
Create Mapping
Create a mapping called m_ODS_CUSTOMER_ACTIVE_xx
In this step a connected Lookup is needed in order to bring back specific existing Customer data
where a Joiner or SQL override will not work correctly. Like a number of other transformations,
Lookups can be configured to be connected or unconnected.
Since the CUSTOMER table has not yet been analyzed or imported as a
Source or a Target, select the Import button (as shown above)
Enter the logon information needed to connect to the odbc_source location
(see flagged step Analyze Source Definitions on page 17)
odbc_source
represents the
Data Source
Name (DSN)
from where the
Lookup table
was imported
the Informatica
PowerCenter
Server will not
recognize this
as a valid
database
connection and
must be
changed
Click here to
open Select
Database Dialog
Box
Select $Source
variable
Completed Mapping
Create Workflow
13
LAB 13 DELETING ROWS
P U R P O S E
To delete rows from an ODS table where customers do not have valid type
codes, i.e., they have not been properly typed or are marked INACTIVE
O B J E C T I V E
D U R ATI O N
25 minutes
S U M M A R Y
Copy mapping
Expand the Mappings node in the assigned folder in the Navigator window
Select the m_ODS_CUSTOMER_ACTIVE_xx and hit Ctrl-C and the Ctrl-V
(See flagged step Copy Mapping on page 93 for other methods of copying
mappings)
Click yes to copy the mapping
Add _del to the mapping name before the student number, xx:
Click-and-drag the mouse pointer over the blue link lines, only,
between the lkp_CUSTOMER and the ODS_CUSTOMER_ACTIVE
and note the lines change to red. If any other objects (e.g.:
transformations) were selected along with the lines, redo the process
Press the Delete key to remove the connections
Add a Filter Transformation to the mapping and give it the name
fil_ODS_CUSTOMER_ACTIVE_delete (See flagged step Create Filter
Transformation on page 116
ISNULL(CUSTOMER_TYPE) OR UPPER(RTRIM(CUSTOMER_TYPE)) =
'INACTIVE'
Completed Mapping
Create Workflow
14
LAB 14 DATA DRIVEN INSERTS AND REJECTS
P U R P O S E
In the previous labs filtering out all of the INACTIVE customers created the
ODS_CUSTOMER_ACTIVE table. In the Customers table
CUSTOMER_TYPE is either set to INACTIVE or ACTIVE. Because Customers
may change from ACTIVE to INACTIVE, Labs 12 and 13 would have to be run
every time ODS_CUSTOMER_ACTIVE is loaded. The use of an Update
Strategy eliminates the need for two mappings to accomplish the same task.
O B J E C T I V E
Create and configure an Update Strategy. Then do inserts and rejects based
on whether the customer type is ACTIVE or INACTIVE
D U R ATI O N
30 minutes
S U M M A R Y
Copy Mapping
Copy the mapping m_ODS_CUSTOMER_ACTIVE_xx and name it
m_ODS_CUSTOMER_ACTIVE_upd_xx
Use an Update Strategy Transformation when keeping history information in a table or updating
a table to keep most current information. In an Update Strategy a record can be flagged to be
updated, inserted, deleted, or rejected using the following constants: DD_UPDATE, DD_INSERT,
DD_DELETE, and DD_REJECT, respectively.
Informatica PowerMart / PowerCenter 6 Basics Lab 14 Data Driven Inserts and Deletes 157
Delete the links between the lkp_CUSTOMER Lookup and
ODS_CUSTOMER_ACTIVE Target Definition
Informatica PowerMart / PowerCenter 6 Basics Lab 14 Data Driven Inserts and Deletes 158
The DD stands for Data Driven. DD_DELETE, DD_INSERT,
DD_REJECT and DD_UPDATE are not listed in the functions
tab, so they must be manually entered in the formula.
IIF(UPPER(RTRIM(CUSTOMER_TYPE))='INACTIVE' or
ISNULL(CUSTOMER_TYPE), DD_REJECT, DD_INSERT)
Informatica PowerMart / PowerCenter 6 Basics Lab 14 Data Driven Inserts and Deletes 159
Completed Mapping
Create Workflow
Informatica PowerMart / PowerCenter 6 Basics Lab 14 Data Driven Inserts and Deletes 160
Results Session Properties
Informatica PowerMart / PowerCenter 6 Basics Lab 14 Data Driven Inserts and Deletes 161
Results Preview Data
Extra Credit
To avoid the database unique constraint violations, there is a very simple solution.
Try the following this exercise to eliminate them.
Informatica PowerMart / PowerCenter 6 Basics Lab 14 Data Driven Inserts and Deletes 162
Edit the sq_INVOICE Source Qualifier in the Properties tab, increase the
value for the Number of Sorted Ports from 0 to 1
Informatica PowerMart / PowerCenter 6 Basics Lab 14 Data Driven Inserts and Deletes 163
Results Extra Credit Session Transformation Statistics
Informatica PowerMart / PowerCenter 6 Basics Lab 14 Data Driven Inserts and Deletes 164
Lab
15
LAB 15 INCREMENTAL UPDATE
P U R P O S E
The PRODUCT and VENDOR source tables will be used to create an ODS
PRODUCT table that has information about the equipment and supplies that
the company resells to customers. This will update the ODS Product table to
keep the most current product information. Only equipment and supplies that
are currently available should be in the table, so all records that are
discontinued will be taken out of the ODS Product table.
O B J E C T I V E
D U R ATI O N
40 minutes
S U M M A R Y
Never change the name of a port that has the Lookup (L)
port checked. Lookup ports are the ports that will be used in
the SQL select statement sent to the database. If column is
renamed, then a database error will occur at session
runtime.
Another Best Practice with the Lookup Transformation is to be discerning when selecting the
columns to be cached. The less cached, the better to prevent wasting system resources that would
likely cause performance degradation. There are two approaches:
Delete the unnecessary port(s) this is not recommended while in development mode;
Uncheck the Output attribute this prevents columns from being unnecessarily cached. This can be
done for those ports that are not needed for the condition, and will not be used downstream in another
transformation. If you later determine that a port is needed, recheck the Output attribute, and the port
will be cached and available.
IIF(ISNULL(PRODUCT_CODE_lkp),
IIF(DISCONTINUED_FLAG = 0, DD_INSERT, DD_REJECT),
IIF(DISCONTINUED_FLAG = 0, DD_UPDATE, DD_DELETE))
Pseudo Code
Just below the expression, the Forward Rejected Rows Checkbox is checked by
default uncheck it to keep rejected rows from being forwarded
Completed Mapping
If the Forward Reject Rows checkbox were checked, 3 rows would have been rejected:
16
LAB 16 FEATURES AND TECHNIQUES II
O B J E C T I V E S
This is the second Instructor-led follow along lesson to show and explain the various
Designer features and tools that can improve efficiency and ease of use. Below is a list
of lessons to be covered:
D U R ATI O N
40 minutes
The Designer includes the Find Next and Find in Workspace tools to help you find
columns or ports in repository objects, or strings in the output window. This can be
very helpful in any number of scenarios including:
Tracing the impact of change through a mapping;
Debugging an invalid port;
Recognizing a miscalculated port value; or
Detecting a mapping logic flow error.
Find in Workspace
Find Next
Unlike Find in Workspace, the Find Next tool can search one
object at a time it cannot search multiple objects at the
same time. The Find Next works in each Designer tool.
Press Enter again to search for the next occurrence of the search string
View Dependencies is a quick and powerful way to do a dependency analysis on virtually any
object in the repository. This is especially powerful because it can be executed from the Designer tool
A simple example is a source needs to be changed. View Dependencies will show all of the
mappings associated with the source. In turn, View Dependencies on those mappings impacted by
the source change identifies the session tasks associated with the mappings.
Open the Navigator Window and expand the Targets Node in the assigned
Student folder
Right-click on the ODS_CUSTOMER_ACTIVE Target Definition and select
View Dependencies
The Designer allows two repository objects of the same type to be compared to
identify differences between them. There are limitations between each of Designer
Tools; however, this is a very powerful feature. The Designer allows for the
comparison of sources, targets, transformations, mapplets, mappings, instances or
mapping/mapplet dependencies in detail. The comparison can be based on two
objects simply within the same mapping, or on two objects across open folders, or
across repositories (e.g. Development, Test, Production).
Expand the Targets Node and pull ODS_EMPLOYEE into the Warehouse
Designer
Click on the Browse button and drill down through the assigned Student folder
to the Targets Node to select ODS_EMPLOYEE_ROOKIE
Differences
would appear
in red
Close and try the same steps with the DIM_REP table compare
ODS_EMPLOYEE to DIM_REP
Click on the Compare button and view the Columns tab
Disconnect from the Studentxx folder and do not save the changes from the
previous lesson
Open Studentxx folder
Open the m_ODS_ORDER_AMOUNT_xx Mapping
Select Mappings | Compare from the main menu
Click on the Browse button for Mapping 2 and select the
m_ODS_ORDER_AMOUNT_sorter_xx Mapping
Click on Compare button
Instances:
This feature assists with maneuvering around mappings with many transformation
instances.
This feature is new with version 6 and allows the developer to copy and paste objects from
mappings and mapplets within the same folder.
One of the primary advantages of using this feature is the ability to select more than one object at a
time and paste the objects into a mapping, mapplet or both.
Keep the following concepts in mind when copying and pasting objects within a folder:
- Objects can be copied from any mapping or mapplet in a folder to any new, existing mapping or
mapplet in the same folder
- Selected objects can be viewed by choosing View | Overview window. Selected objects will appear
in color.
Objects cannot be copied from a shortcut to a mapping or mapplet nor is it allowed to paste objects
into a shortcut to a mapping or mapplet
Lesson 6 Shortcuts
One of the primary advantages of using a shortcut is maintenance. If a change is needed to all
instances of an object, make the change to the original repository object and all shortcuts to it will
automatically inherit those changes. In contrast, if there are multiple copies of an object, each will
need to be updated.
A word of caution, changes can invalidate mappings and sessions. For example, if there is a shortcut
to a reusable transformation and simple Precision change is made to a port, each and every mapping
with a shortcut to that object will become invalid, which in turn, invalidates the session tasks using
those mappings.
The key is to plan and use the Dependency Analysis Features to determine the impact of the change
and plan accordingly. If the change is needed immediately, then temporarily make a copy of the object
until the shortcut can be updated
If it does not, then start over and make sure the object is
being dragged in from the Shared_Student Folder.
Click on Yes to create the shortcut make sure it doesnt say copy
17
LAB 17 ROUTER
P U R P O S E
To develop a mapping where a row can be mapped to any one of or all three
possible Targets
O B J E C T I V E
D U R ATI O N
30 minutes
S U M M A R Y
SOURCE: ODS_EMPLOYEE
TARGETS: ODS_EMPLOYEE_SALES, ODS_EMPLOYEE_NON_SALES,
ODS_EMPLOYEE_ROOKIE
Create Mapping
Create a mapping called m_ODS_EMPLOYEE_TYPE_xx
A Router Transformation tests each row against one or more conditions, called groups, and flags the
row true allowing it to pass through that group. Each row will be tested against each and every group,
so it can be dispersed across many groups if the conditions are met.
Another advantage the Router has over the Filter is if the row does not meet any of the defined group
conditions, it will route the row to the Default Group. This feature alone makes it great transformation
for error handling.
Completed Mapping
Create Workflow
ODS_EMPLOYEE_NON_SALES
ODS_EMPLOYEE_ROOKIES
18
LAB 18 STRAIGHT LOAD
P U R P O S E
In the exercise that follows this one, there is a table, ODS_LINE_ITEM that will
have a foreign key relationship with the table in this exercise, ODS_INVOICE.
Ultimately, the aforementioned tables will be joined together in another exercise.
O B J E C T I V E
D U R ATI O N
10 minutes
S U M M A R Y
SOURCE: INVOICE
TARGET: ODS_INVOICE
Import Target
A Mapplet to be developed during a later lab will need two sources, ODS_INVOICE
and ODS_LINE_ITEMS. ODS_INVOICE has not been populated in any previous
exercise
Create Mapping
Completed Mapping
Create Workflow
19
LAB 19 CONDITIONAL LOOKUP
P U R P O S E
Read from a large source that has a few rows of invalid data. To validate
specific data, look up the value in another table. This is only necessary for
about one row out of ten
O B J E C T I V E
Build a mapping to load an ODS table that contains line item data that will
ultimately be used to load the fact table in the data mart
D U R ATI O N
30 minutes
S U M M A R Y
Continue to work in the assigned student folder and import the relational
source, LINE_ITEM. The Sources PRODUCT and INVOICE tables have
already been imported for use in previous mappings and should be in the
Sources node.
Create Mapping
Create a mapping called m_ODS_LINE_ITEM_xx
If present, delete all of the Source Qualifiers (see flagged step Create
Source Qualifier on page 167 for more information)
A Mapping Parameter represents a constant value that can be defined before running a
session task. A mapping parameter retains the same value throughout the entire session. By creating
these, hard coding values within logical expression can be avoided.
Hit the Tab key to jump to the Type column and click on the down-arrow or
type the letter p to select Parameter
Hit the Tab key to jump to the Datatype column and click on the down-arrow or
type the letter d, twice, to select decimal. If you bypass decimal, continue
to cycle through all of the Datatypes that begin with d until decimal is found
Set Precision to 10 and Scale to 2
Click in the Initial Value: edit box and key in .00
Validate the initial value by clicking on the Validate button at the far right
of the edit box
Click the ADD button, again
In the Name column, type $$MAX_RATE
Select Parameter as the Type
Select decimal as the Datatype
Set Precision to 10 and Scale to 2
Set Initial Value: .35 and validate
The bottom line is, choose the ports as they are listed in the
bullet and ignore the names in the picture, as they may be
different based on how the
sq_PRODUCT_INVOICE_LINE_ITEM was created.
Rename the ports to exclude the number 1 where it was appended (e.g.
INVOICE_NO and PRODUCT_CODE)
DISCOUNT port should be Input port, only
Insert a new port called DISCOUNT_RATE_out (after the DISCOUNT port)
Click OK
Unconnected Lookups
A Connected Lookup takes every row passed to it, processes it based on the lookup condition and
passes it downstream to the next transformation. It should only be used when the majority or all of
the rows are required to pass through it or when more than one port (return value) is required from
the Lookup.
On the other hand, an Unconnected Lookup is called upon conditionally. It is ideal to use when the
majority or all of the rows do not need a return value (ports) from it. This conditional Lookup is called
unconnected because no physical links are present it stands alone, unconnected.
To use it, it must be called upon by a formula in some other transformation; typically in a Filter or
Update Strategy Transformation. Several ports may be passed to it to complete the condition,
however, only one value may return designated by a new port attribute, the R (return) port (see
below).
The R port is only required in when the Lookup is unconnected. If checked while connected, it will
be ignored. Only one port can be selected, hence it acts like a radio button.
Another common usage of an unconnected lookup is when it needs to be called several times from
different expressions again, considering all of the limitations mentioned above.
1) Every row does NOT need a return value from the Lookup, in other words, can be called
conditionally; and
Edit Expression
Add an expression that includes a formula that calls the Lookup Transformation, hence the
name of the Lab, Conditional Lookup
The reason for not doing this step during the Create
Expression step is the Lookup Transformation, for which will be called in a
formula, did not exist. This demonstrates a logical and iterative approach
to development.
For connected transformations, if the point-and-click method is used to enter port names in an
expression, the Designer updates that expression when port names are changed in the
transformation. For example, a valid expression is written that determines the difference between two
dates, Date_Promised and Date_Delivered. Later, Date_Promised port name is changed to Due_Date.
If the expression is developed using the point-and-click method, the Designer changes the
Date_Promised port name to Due_Date in the expression. If, however, the expression was written
manually, it must be updated manually to maintain a valid expression.
From the Functions tab, expand the Special category and double-click on the
IIF function. Notice the function appears in the Formula work area with
parenthesis in place.
Expand the Test category and double-click on the ISNULL function. Again, note
that this function is inserted automatically within the original parenthesis
From the Ports tab and double-click on the DISCOUNT port
Position the cursor between the two right parentheses and click on the OR
button from the Operator Keypad
Add the DISCOUNT port again
From the Operator Keypad, click the less-than (<) button
From the Variable tab, expand the Mapping Parameters folder and double-click
on $$MIN_RATE
From the Operator Keypad, click on the OR button
Return to the Ports tab, add the DISCOUNT port, yet again
Position the cursor between the two right parentheses and insert a (,)
(comma)
Return to the Ports tab, add the DISCOUNT port
Your function should look like this:
Create Workflow
20
LAB 20 HETEROGENEOUS TARGETS
P U R P O S E
To alter the mapping created in the Router lab to send rows not loaded into
any of the three target tables to a flat file for inspection
O B J E C T I V E
D U R ATI O N
15 minutes
S U M M A R Y
SOURCE: ODS_EMPLOYEE
TARGETS: ODS_EMPLOYEE_SALES, ODS_EMPLOYEE_NON_SALES,
FF_EMPLOYEE_INVALID_xx
Click OK
Copy Mapping
Copy the m_ODS_EMPLOYEE_TYPE_xx mapping and call it
m_ODS_EMPLOYEE_INVALID_TYPES_xx
Edit Mapping
Delete the ODS_EMPLOYEE_ROOKIE Target Definition from the mapping
Create Workflow
21
LAB 21 MAPPLETS
P U R P O S E
The purpose of this lab is to introduce the concept of Mapplets. Mapplets are a group
of transformations that are saved as a set. This set then becomes reusable, and can
be used in any mapping. The mapplet created here will be used in next lab.
O B J E C T I V E
D U R ATI O N
30 minutes
S U M M A R Y
Once saved, Mapplets are stored in their own node called Mapplets, visible in the Navigator window
and can be used in any mapping by dragging and dropping the mapplet into the mapping from the
Navigator window.
Creating Mapplets can save time by eliminating the need to create the same set of transformations
again and again. They also enforce standards.
From a graphical user interface (GUI) perspective, there are very few differences between the Mapplet
Designer and the Mapping Designer they are virtually mirror images of each other. The primary
differences are which transformation objects can be used and there are limitations -- the majority, of
which, exist within the Mapplet Designer.
Furthermore, most objects can be copied between them. This is key because mapplets usually come
to fruition as a result of mappings. If, after a mapping has already been created, it has been
determined that the complexity and reusability warrants the creation of a Mapplet, it is easy to copy
those key objects without building them from scratch.
Completed Mapplet
22
LAB 22 REUSABLE TRANSFORMATIONS
P U R P O S E
The mapplet created in the previous exercise supplies a profit value for each
sales rep, customer, product, and date. In this lab, the data will be distributed
among four ODS tables, one that will hold the data on a daily level, which is
how it is coming directly from the mapplet, and the other three will hold the
same data summarized or aggregated on a monthly, quarterly and yearly
basis, respectively. To accomplish the further aggregation required (monthly,
quarterly and yearly), three general-purpose Reusable Aggregator
transformations will be created. The Aggregators are considered general
purpose (generic) because each can take any numeric data regardless of
the meaning of that data and summarize it on a monthly, quarterly and
yearly level.
O B J E C T I V E S
D U R ATI O N
75 minutes
S U M M A R Y
Add Mapplet
Add the mplt_PROFIT_PERCENT, created in the previous exercise, to the
mapping from the Mapplets Node
The Lookup transformation has several performance enhancement properties related to its
cache specifically size and refresh parameters. One of those properties is called Lookup cache
persistent.
If a lookup is performed more than once, either within the same session or in another, and the data
does not change for several runs then consider using this property. If the intent is to use this property
across sessions, then another property, Cache File Name Prefix needs to be selected to share the
cache
If at some point in the various workflows and session tasks that use the Lookup Cache the data needs
to be refreshed, another property can be used to force the persistent cache to be refreshed called
Recache from the Database.
Create a Lookup against the ODS_TIME table in the assigned target schema
and name it lkp_ODS_TIME
Edit the lkp_ODS_TIME Lookup Procedure and select the Lookup cache
persistent property
Enter lkp_ODS_TIME_xx in the Cache File Name Prefix property
Create Aggregator
This mapping presents a good opportunity to create three reusable (general purpose)
transformations for other mappings to use ultimately this will reduce duplication of
effort and ensure accuracy. Often it is easier to get a visual perspective on what is
being built in the Mapping Designer, first, and then promote a specific transformation
to be reusable.
SUM(PROFIT_in)
Reusable Transformations
Standard transformations exist within a single mapping. Reusable transformations can be used in
multiple mappings or mapplets.
Rather than re-creating a transformation with the very same logic several times, create a reusable
transformation. Wherever the reusable transformation is needed, add an instance of it to the mapping.
The Designer stores each reusable transformation as metadata separate from any mapping that uses
the transformation similar to a shortcut. Once promoted to be reusable, the transformation will
appear in the Transformations Node and only to be edited in the Designers Transformation
Developer.
One of the Transformation Developer purposes is for editing reusable transformations. Changes
made on the Ports Tab of a reusable transformation are inherited by all its instances and automatically
reflects those changes. Instances of the reusable transformation do not inherit changes on the
Property Tab (with the exception of the Sequence Generator Transformation) only modifications to
Transformation, Ports, Condition, Groups and Metadata Extension Tabs are passed.
Edit agg_3_ID_SUM_BY_MTH
Click on the Ports tab and note the ports are not editable they have been
completely grayed out; on the other hand, the attributes displayed on the
Properties Tab are editable
Create Workflow
Link start_ODS_PROFIT_PERIODIC to
s_m_ODS_PROFIT_PERIODIC_xx
Save, Validate and Start Workflow wf_ODS_PROFIT_PERIODIC_xx
Monitor and Review the results for s_m_ODS_PROFIT_PERIODIC_xx in
the Workflow Monitor
E X T R A C R E D I T
Turn on the property, Recache from Database, located on the Transformations tab
of the session task, s_m_ODS_PROFIT_PERIODIC_xx
Results
All the numbers should be the same as the above results. The difference is in the data
there should no longer be any Nulls.
ODS_PROFIT_MONTHLY
Based on the fact there were no calculations being performed by the reusable
transformations re_agg_3_ID_SUM_BY_MTH and re_agg_3_ID_SUM_BY_QTR
because the lkp_ODS_TIME provided it, could these transformation been combined
into one?
23
LAB 23 DYNAMIC LOOKUP
P U R P O S E
Build a mapping to load the DIM_PRODUCT table when source rows do not
exist on the target
O B J E C T I V E
D U R ATI O N
30 minutes
S U M M A R Y
SOURCE: ODS_PRODUCT
TARGET: DIM_PRODUCT
In this step a lookup will be utilized to determine if source rows exist in the target table. When the
Dynamic Cache property is set on a Lookup Transformation, all rows sent to the Target will also
update the lookup cache. Therefore, the Target and the lookup cache will be in sync.
Completed Mapping
Create Workflow
Create a Workflow called wf_DIM_PRODUCT_xx
Add wf_DIM_PRODUCT_xx.log as the Workflow Log File Name
Rename Start task to start_ DIM_PRODUCT
Create Session Task called s_m_DIM_PRODUCT_xx
Select native_target_xx connection for sq_ODS_PRODUCT source instance
Select native_target_xx connection for DIM_PRODUCT target instance
Check property Truncate target table option
Only if the target table database connection is using an Oracle client
less than 8.1.7.2, select Normal for Target load type property
Link start_ DIM_PRODUCT to s_m_DIM_PRODUCT_xx
Save, Validate and Start Workflow wf_DIM_PRODUCT_xx
Monitor and Review the results for s_m_DIM_PRODUCT_xx in the Workflow
Monitor
24
LAB 24 SEQUENTIAL WORKFLOW
P U R P O S E
Build a workflow to load the remaining dimensions table, and then the fact
table to complete the course.
O B J E C T I V E
D U R ATI O N
30 minutes
S U M M A R Y
Create Workflow