Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
PowerMart /
PowerCenter 6 Basics
LAB GUIDELINES
• Note that there are dependencies among the labs – subsequent labs require
objects that were created in previous labs. If you are unable to complete a lab
during the allotted time, you can obtain a copy of the required objects from
the Shared_Student folder. (Your instructor will describe the process for
obtaining these objects.)
• Screen shots are based on columns that are not selected by default. All of
the transformation objects used in this course have the following columns
selected: Name, Datatype and Length/Precision. Others will include
Expression.
1
THE DESIGN PROCESS
The first several labs will provide a step-by-step review of the Informatica Design
Process.
OV E 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 AT I 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.
In this course, each student will create his/her own folder.
All PowerCenter objects (and relationships) created in the
labs will be stored in this folder.
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 AT I 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 6.
Open Folder
Once you’ve 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
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
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
The object disappears from the Workspace, yet can be found in the assigned
Studentxx folder in the Navigator window (see page 14).
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 AT I 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 database owner name
• 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 AT I 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
If the same source table name, EMPLOYEE, were imported via a different ODBC DSN into the
same folder, the repository wouldn’t 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 server’s perspective, not the client workstations, and will be discussed in
greater detail when the Workflow Manager is covered.
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.
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.
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
Window’s
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 window’s ‘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 AT I 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 6
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.
There are several parameters in the new workflow to be set. Edit the workflow by
doing one of the following:
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
• 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
Window’s
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 window’s ‘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 AT I 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 49
• 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 50
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
The menu option Start Task (shown below) is not ideal in this
case.
Starts a single
Task only
Informatica PowerMart / PowerCenter 6 Basics – Lab 6 – Start and Monitor the Workflow 51
Any of the above options would show the following dialog box:
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 52
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 53
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
• Accept the default or enter the assigned Repository studentxx Username and
then the Password
Informatica PowerMart / PowerCenter 6 Basics – Lab 6 – Start and Monitor the Workflow 54
• 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
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 55
Monitoring the Workflow
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
• The start_ODS_EMPLOYEE Task -- icon
• The wf_ODS_EMPLOYEE_xx Workflow -- icon
Informatica PowerMart / PowerCenter 6 Basics – Lab 6 – Start and Monitor the Workflow 56
Workflow Monitor Time
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 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 57
° Double-click on the selected line for s_m_ODS_EMPLOYEE_xx
Session
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 58
Target
Instance
Transformation
Statistics Tab
Source
Qualifier
Instance
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.
• Right-click on Session in the Task Name column (Time window) and select Get
Session Log; or
Informatica PowerMart / PowerCenter 6 Basics – Lab 6 – Start and Monitor the Workflow 59
• 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 60
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 AT I O N
• 40 minutes
Connect to Repository
• Connect to the PC_Course Repository (refer to flagged step Connect to the
Repository on page 6)
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
If there was nothing to save, don’t fret. This step was just
in case the steps above were not needed to open the
mapping and a saved wasn’t previously performed.
• 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
• To demonstrate that objects can not be reverted back individually, remove the
NAME_out and DATE_HIRED ports from the exp_ODS_EMPLOYEE
Expression
• Remove the DATE_HIRED port from the sq_EMPLOYEE Source Qualifier
• With the sq_EMPLOYEE Source Qualifier being the only object selected,
select Edit | Revert to Saved
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 don’t 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
• 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
• 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 AT I O N
• 30 minutes
S U M M A RY
• In Designer, open the folder and open the Source Analyzer by clicking the
Source Analyzer Icon or by selecting Tools | Source Analyzer
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 Server’s perspective – never from the client workstation.
Informatica PowerMart / PowerCenter 6 Basics – Lesson 9 – Flat File Wizard and Filter 84
• 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 first extract contained
Informatica PowerMart / PowerCenter 6 Basics – Lesson 9 – Flat File Wizard and Filter 85
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 86
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 87
Import Target Table
Create Mapping
• Create a new mapping called m_ODS_TIME_xx (refer to the flagged step
Create the Mapping on page 23)
Informatica PowerMart / PowerCenter 6 Basics – Lesson 9 – Flat File Wizard and Filter 88
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 89
• 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 30).
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 90
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 91
• 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 92
Create Workflow
Complete the following steps (refer to Start Workflow Manager on page 37)
° Start Workflow Manager
° Connect to Repository
° Open Folder
Informatica PowerMart / PowerCenter 6 Basics – Lesson 9 – Flat File Wizard and Filter 93
• 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 94
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 13.
• 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 95
Informatica PowerMart / PowerCenter 6 Basics – Lesson 9 – Flat File Wizard and Filter 96
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 vendor’s 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 AT I O N
• 35 minutes
S U M M A RY
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. It’s 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 AT I O N
• 20 minutes
S U M M A RY
Copy Mapping
The first step will be to copy the previous mapping
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 it’s 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 AT I O N
• 40 minutes
S U M M A RY
Create Mapping
• Create a mapping called m_ODS_CUSTOMER_ACTIVE_xx
• 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 13)
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 AT I O N
• 25 minutes
S U M M A RY
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 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 91
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 AT I O N
• 30 minutes
S U M M A RY
Copy Mapping
• Copy the mapping m_ODS_CUSTOMER_ACTIVE_xx and name it
m_ODS_CUSTOMER_ACTIVE_upd_xx
Informatica PowerMart / PowerCenter 6 Basics – Lab 14– Data Driven Inserts and Deletes 129
• 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 130
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 131
Completed Mapping
Create Workflow
Informatica PowerMart / PowerCenter 6 Basics – Lab 14– Data Driven Inserts and Deletes 132
Results – Session Properties
Informatica PowerMart / PowerCenter 6 Basics – Lab 14– Data Driven Inserts and Deletes 133
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 134
• 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 135
Results – Extra Credit Session Transformation Statistics
Informatica PowerMart / PowerCenter 6 Basics – Lab 14– Data Driven Inserts and Deletes 136
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 AT I O N
• 40 minutes
S U M M A RY
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, on the other hand, the lookup on the target table is expected
to have rows in it from a previous run of the session task, then
there is a problem to investigate.
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 AT I 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
The Find Next tool can search for a column or port name
(or any set of characters in a name) in: Transformations,
Mapplets, Source and Target Definitions.
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
• Right-click on ODS_EMPLOYEE, select Compare Objects… and a different
dialog box will appear than the last
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
As the cursor enters the workspace, the icon should look
as follows as:
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 doesn’t 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 AT I O N
• 30 minutes
S U M M A RY
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
Hold down the Ctrl key as each table is selected so that all
three tables can be moved at the same time
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.
Try Autolink to see the way groups are displayed and since
the port names will have numbers associated with them in
the Router Transformation it will either be a link by position
• Save
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 AT I O N
• 10 minutes
S U M M A RY
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 AT I O N
• 30 minutes
S U M M A RY
• 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 139 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
2) Only one port is required (‘R’ port) for the return value
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.
• 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 AT I O N
• 15 minutes
S U M M A RY
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 AT I O N
• 30 minutes
S U M M A RY
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 AT I O N
• 75 minutes
S U M M A RY
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 Designer’s 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 AT I O N
• 30 minutes
S U M M A RY
SOURCE: ODS_PRODUCT
TARGET: DIM_PRODUCT
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
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 AT I O N
• 30 minutes
S U M M A RY
Create Workflow