Professional Documents
Culture Documents
x
Level One Developer
Lab Guide
Version: PC95_L1D_201311
6,029,178;
6,789,096;
7,254,590;
7,774,791,
ii
Preface
Welcome to the PowerCenter 9x Level One Developer course.
This four-day, instructor led course introduces students to Informatica PowerCenter 9.x
through lecture and hands-on exercises. The course is designed for Data Integration
Develops new to Informatica PowerCenter.
Informatica PowerCenter is a collection of thick client workbench tools that Developers
can use to create, execute, monitor and schedule Data Integration processes.
The course will introduce attendees to working with the PowerCenter Designer,
Workflow Manager, and Workflow Monitor tools, performing tasks such as creating
transformations, mappings, reusable objects, sessions and workflows to extract, transform
and load data. They will develop cleansing, formatting, sorting and aggregating
procedures. They can learn how to use routers, update strategies, parameters /variables
and overrides. This course will cover many different types of lookups, such as cached,
persistent, dynamic and multiple row returns. Workflow tasks will be created to define a
set of instructions for executing the Data Integration routines.
Prerequisites:
Prerequisites include basic familiarity with Windows GUI and at least two years work
experience and some knowledge of SQL.
Course Objectives:
After successfully completing this course, students should be able to:
Use Informatica Support to resolve questions and problems with PC9.x.
Use PowerCenter 9.x Designer to build mappings that extract data from a source
to a target, transforming it as necessary.
Use PowerCenter transformations to cleanse, format, join, aggregate and route
data to the appropriate targets
Perform error handling/trapping using PowerCenter mappings
Use PowerCenter 9.x Workflow Manager to build and run a workflow which
executes a sessions associated with a mapping
Design and build simple mappings and workflows based on essential business
needs.
Perform basic troubleshooting using PowerCenter logs and debugger
Audience:
This course is designed for database developers with little or no experience of
PowerCenter.
.
iii
Document Conventions
This guide uses the following formatting conventions:
If you see
It means
Example
>
boldfaced text
UPPERCASE
T_ITEM_SUMMARY
Note:
Tip:
italicized text
iv
Providing Feedback
Email any comments on this guide to education@informatica.com.
WebSupport requires a user name and password. You can request a user name and password at:
http://mysupport.informatica.com.
vi
Asia / Australia
Informatica Business
Solutions Pvt. Ltd.
301 & 302 Prestige Poseidon
139 Residency Road
Bangalore 560 025
India
Toll Free
877 463 2435
Toll Free
00 800 4632 4357
Standard Rate
United States: 650 385 5800
Standard Rate
Belgium: +32 15 281 702
France: +33 1 41 38 92 26
Germany: +49 1805 702 702
Netherlands: +31 306 022 797
United Kingdom: +44 1628 511 445
Toll Free
Australia: 00 11 800 4632
4357
Singapore: 001 800 4632 4357
Standard Rate
India: +91 80 5112 5738
vii
viii
TableofContents
LabActivity2.1:CreateSTG_DealershipMapping.......................................................................................1
LabActivity2.2:CreateSTGPaymentMapping.........................................................................................13
LabActivity2.3:CreateSTG_DealershipWorkflow....................................................................................29
LabActivity2.4:CreateSTGPaymentWorkflow........................................................................................37
LabActivity2.5:LogEventsReview............................................................................................................45
LabActivity3:Troubleshooting..................................................................................................................55
LabActivity4.1:LoadSTGCustomerTarget...............................................................................................71
LabActivity4.2:LoadtheSTGEmployeesTarget.......................................................................................91
LabActivity5:FeaturesandTechniques..................................................................................................109
LabActivity6.1:UsingHomogeneousJoinstoloadtheSTGProductTarget...........................................115
LabActivity6.2:TroubleshootingHomogeneousJoins............................................................................123
LabActivity6.3:UsingHeterogeneousJoinsandLinkConditions............................................................135
LabActivity7:UsingtheDebugWizard....................................................................................................147
LabActivity8.1:UsingaLookuptoLoadtheODSEmployeeTarget........................................................157
LabActivity8.2:Troubleshooting$SourceConnectionVariables............................................................177
LabActivity8.3:UsingaSequenceGeneratortoloadODSDatesTarget................................................193
LabActivity8.4:CreatingaLookupCacheandLoadingtheODSPromotionsTarget..............................201
LabActivity8.5:ActiveLookups...............................................................................................................211
LabActivity9:UpdatingTargetsUsingPowerCenter...............................................................................221
LabActivity10.1:UsingPowerCentertoLoadtheFactSalesTarget.......................................................247
LabActivity10.2:CreateaMapplet..........................................................................................................263
LabActivity11:MappingWorkshop.........................................................................................................267
LabActivity12:WorkflowWorkshop.......................................................................................................275
Getting started
This training environment serves multiple course requirements. Because of this, the background
services required for each course are set for manual start.
A user friendly menu has been created which will Start or Stop all the services required for each
course.
Step 1. Login to the image.
1) Log into your image using the Administrator/admin user and password.
Step 2. Start the Informatica Services
1) To access the menu, reference the Stoplight icon located near the lower left of the Windows
desktop.
2) Click the Stoplight icon to reveal the course menu and from the list available choose to start the
Level_1_Developer > 1. Class Services start. The services may take approximately 10-15 minutes to
start initially. You will only need to do this once during the course. Once they have been started
they can be left running.
Note: Variations in the Stoplight menu may exist however you are required to start the
Level_1_Developer services.
Note: The status is displayed in green so you will be able to see when the services have started.
Getting Started
3) Once complete, to verify the services are running, open Firefox and from the Favorites menu or
bar select Informatica Administrator.
a) If the services have been started you will be able to log in as Administrator/admin.
Note: If you are not presented with this page you will need to wait a few more minutes.
Note: Typically you will not need to start the services as this is an Administration task.
4) To verify all of the services are up and running, when you have logged in to Informatica
Administrator (using the user name Administrator and the password admin), select the EDW_DEV
folder to the left and the services will be displayed in the window to the right.
Verify that the services have a green tick beside them to indicate they are running.
The following services should be running:
IS_EDW_DEV
REP_EDW_DEV
Getting Started
Note: There may be slight variations in the folders that exist in the Administrator. We are
only interested in the EDW_DEV services folder.
Modify the Note at the top of page 2 to read as the following:
Note: For instructor guided courses: Throughout this and later exercises, xx will refer to the
student number assigned to you by your Instructor or the machine you are working on. For
example, if you are Student05, then Devxx refers to folder Dev05.
Note: For onDemand courses: Throughout this and later exercises, xx refers to your student
number. Use 01 as your student number. References to Devxx will therefore be Dev01.
Getting Started
Scenario:
You have been asked to learn how to use Informatica PowerCenter in order to
more efficiently accomplish your organizations ETL objectives and automate the
development process. Because you have limited or no prior exposure to this
software, this exercise will serve to orient you to the basic development interfaces.
You will create a pass-through mapping to load Dealership data from a relational
source into the STG_DEALERSHIP target table.
Objectives:
Duration:
15 minutes
Subject
Review
PowerCenter includes two development applications, the Designer, which you will
use to create mappings, and the Workflow Manager, which you will use later to
create and start workflows. This exercise is designed to serve as your first handson experience with PowerCenter, and supplement the instructor demonstrations.
You will import source and target definitions from the database as well as create
shortcuts from the Dev_Shared folder. You will create a pass-through mapping.
Walkthrough:
Start the
PowerCenter
Designer
Note: Throughout this and later exercises, xx will refer to the student number
assigned to you by your Instructor or the machine you are working on. For example,
if you are Student05, then DEVxx refers to the folder DEV05.
1. On your desktop, double-click the PowerCenter Designer icon (
) to start it.
Walkthrough:
Create a
Relational
Source
1. From the menu, select Tools Source Analyzer. The workspace to the right
of the Navigator window changes to an empty space.
Note: The small toolbar directly to the right of the Navigator window, at the top.
There are the five Designer tools. Each tool allows you to create and modify one
specific type of object, such as sources. The figure below shows the Designer tools
with the first tool (the Source Analyzer) selected.
The Import Tables dialog should appear the same as displayed in the figure below.
Note: You can select multiple objects for simultaneous import by using the Ctrl key.
b. Click OK.
The DEALERSHIP source definition will appear in the Source Analyzer
workspace as shown in Figure 6 below:
View the bottom left pane of the Designer. This is the Output Window. You will see
a notification that the source was successfully saved.
Walkthrough:
Create a
Relational
Target
1. From the Designer Tools menu, select Target Designer has shown in the figure
below:
Walkthrough:
Create a
Mapping
1. Open the Mapping Designer by clicking the respective icon in the toolbar. The
icon is shown highlighted below:
STG_DEALERSHIP
DEALERSHIP_MANAGER_ID
DEALERSHIP_MANAGER_ID
DEALERSHIP_DESC
DEALERSHIP_DESC
DEALERSHIP_LOCATION
DEALERSHIP_LOCATION
DEALERSHIP_STATE
DEALERSHIP_STATE
DEALERSHIP_REGION
DEALERSHIP_REGION
DEALERSHIP_COUNTRY
DEALERSHIP_COUNTRY
7. When you are done linking the ports, right-click within the mapping area and
select the menu option Arrange All.
10
11
12
Scenario:
You have been given a Payments flat file that needs to be loaded into a relational
Staging Oracle table that has the same definition as the flat file. The DBA is too
busy to assist at this time. You can build the relational definition using
PowerCenter and execute the auto-created DDL to generate the physical table on
the database.
Objectives:
Learn how to create a mapping that loads from a flat file to a relational table.
Duration:
30 minutes
Subject
Review
The student will create the flat file source for Payments. Then a relational target
definition will be created. After this is saved to the repository, the DDL will get
generated and executed on the database. The student will verify that the physical
table does exist, and then create the mapping.
13
Walkthrough:
Create a Flat
File Source
1. If you are not already in the PowerCenter Designer Tool, please start it
according to the instructions in Lab 2.1
2. Return to the Source Analyzer by selecting Tools Source Analyzer.
14
c. Select payment.txt
d. Click Open.
i. The Flat File Import Wizard appears.
ii. Confirm that the Delimited option button is selected.
iii. Select the Import Field Names from the first line checkbox.
15
16
Confirm that the field names are displayed under Column Information. These were
imported from the first line of the flat file.
17
Walkthrough:
Create Target
Definition
from Source
Definition
1. Select the Target Designer icon from the Designer Tools Toolbar above the
Source Analyzer workspace as shown below:
2. Right-click anywhere in the Target Designer workspace and select Clear All.
a. In the Navigator window, open the Sources folder.
b. Open the FlatFiles subfolder
c. Select the payment source definition as shown below:
18
d. Click OK.
5. Select Ctrl-S to save your new target definition to the repository.
a. Verify through the Output window that your Source and Target definitions
saved successfully to the repository
19
Observe the Target folder of your repository folder in the Navigator window and
note that the STG_PAYMENT target has been added.
20
Walkthrough:
Create the
physical
Payment
Database
table.
21
22
Note that the Output window confirms that the file has been created.
2. Select Edit SQL File. The file should appear as displayed below:
Note the Output window confirms the creation of the physical database table.
23
Walkthrough:
Verify the
physical
table exists
on the
database
24
Note that the appropriate columns exist in the table as shown in the figure
below:
You have just verified that the physical table has been created and committed on
the physical database.
g. Close the SQL Developer application.
25
Walkthrough:
Create a
Mapping
1. Open the Mapping Designer by clicking the respective icon in the toolbar. The
icon is shown highlighted below:
26
27
28
Scenario:
You have been asked to learn how to use Informatica PowerCenter in order to more
efficiently accomplish your organizations ETL objectives and automate the
development process. Because you have limited or no prior exposure to this
software, this exercise will serve to orient you to the basic development interfaces.
You will create a workflow with relational connections to load Dealership data from
a relational source into the STG_DEALERSHIP target table
Objectives:
Understand the purpose of the tools accessed from the Workflow Manager.
Duration:
15 minutes
Subject
Review
PowerCenter includes two development applications, the Designer, which you have
already used create mappings, and the Workflow Manager, which you will use to
create and start workflows. This exercise is designed to serve as your first handson experience with PowerCenter, and supplement the instructor demonstrations.
29
Walkthrough:
Create a
Workflow
and a
Session Task
1. Launch the Workflow Manager by clicking on the respective icon in the toolbar.
The icon is shown highlighted below:
2. Open the Workflow Designer workspace by clicking the respective icon in the
toolbar. The icon is shown highlighted below:
a. Grab the handle of the Task Toolbar and pull it to the left so that it is easily
accessible.
5. Create the Session task.
a. Click on the Session icon on the toolbar. The icon is shown highlighted
below:
30
a. Select the Start Task and drag the link to the Session task.
When completed the workflow should appear as follows:
31
Walkthrough:
Configure
the Source
Connection
b. Click OK.
32
Walkthrough:
Configure
the Target
Connection
33
3. Select Connections on the left side of the Edit Tasks screen. The screen
should appear as shown below:
i. Click OK.
b. Click Ctrl-S to save the workflow to the repository
34
Walkthrough:
Start the
Workflow
35
Walkthrough:
Data Results
1. In the Designer, you can view data that was loaded into the target.
a. Right-click on the STG_DEALERSHIP target definition.
i. Select Preview Data.
ii. Set the ODBC Data Source to STG.
iii. Enter the user name STGxx.
iv. Enter the password STGxx and click the Connect button.
v. Your data should appear as displayed below:
36
Scenario:
You have created a mapping which loads a Payments flat file into a relational
Staging Oracle table. You now need to create a workflow which will contain the
location of the flat file for the source as well as the connection for the relational
target table.
Objectives:
Understand the purpose of the tools accessed from the Workflow Manager.
Duration:
15 minutes
Subject
Review
37
Walkthrough:
Create a
Workflow
and a
Session Task
1. If you are not already logged into the Workflow Manager, launch the application
by clicking on the respective icon in the toolbar as shown in Lab 2.3.
2. Open the Workflow Designer workspace by clicking the respective icon in the
toolbar as shown in Lab 2.3.
a. If a workflow already exists within the workspace, select menu option
Workflows Close.
3. Select the menu option Workflows Create.
a. Delete the default workflow name and enter wf_m_STG_PAYMENT_xx.
b. Click OK.
The Start Task will appear on your workspace.
4. Create the Session task.
a. Click on the Session icon on the toolbar.
b. Click on the Workflow Designer workspace.
i. The Mappings List dialog with a list of mappings to associate with your
session task will appear. Choose the m_STG_PAYMENT_xx mapping.
ii. Click OK.
5. Link the Start task to the session s_m_STG_PAYMENT_xx.
6. When completed the workflow should appear as follows:
38
Walkthrough:
Configure
the Session
by setting
the Source
Connection
Note:
$PMSourceFileDir\ is
the PowerCenter
variable which
currently points to
c:\infa_shared\SrcFiles
This variable can be
changed in the
PowerCenter
Administrator tool.
39
Walkthrough:
Configure
the Target
Connection
40
2. Select Connections on the left side of the Edit Tasks screen. The screen
should appear as shown below:
a. Click OK.
b. Click Ctrl-S to save the workflow to the repository.
41
Walkthrough:
Start the
Workflow
42
Walkthrough:
Data Results
1. In the Designer, you can view data that was loaded into the target.
a. Right-click on the STG_PAYMENT target definition.
i. Select Preview Data.
ii. Set the ODBC Data Source to STG.
iii. Enter the user name STGxx.
iv. Enter the password STGxx and click the Connect button.
v. Your data should appear as displayed below:
43
44
Scenario:
Your workflows have completed successfully. However, you still feel you should
familiarize yourself with the logging functions of PowerCenter.
Objectives:
Learn how to access the Workflow and Session logs in the Workflow Monitor.
Learn location of workflow names, folder names, and Integration Service names
within both workflow and session logs.
Duration:
15 minutes
Subject
Review
The student will use the Workflow Monitor to access the Workflow and Session logs
of the last workflow and familiarize themselves with all the valuable information
included there.
45
Walkthrough:
Access the
Workflow
Logs
1. If you are not already logged into the Workflow Monitor, launch the application
by clicking on the respective icon in the toolbar.
2. The wf_m_STG_PAYMENT_xx workflow should already be open within the
workspace.
3. Right-click the wf_m_STG_PAYMENT_xx and select the menu option Get
Workflow Log.
46
6. Note that the Link between the Start Task and the Session
s_m_STG_PAYMENT_xx has an empty expression. There will be more on
link expressions in a later module.
47
7. Note the name of the node in which the session instance was executed. You
may have to adjust the columns by grabbing the handle of the column header.
i. Note the name of the domain and the name of the user who is
connected to the repository.
ii. Note the notification of successful execution of both the session and
the workflow.
Walkthrough:
Access the
Workflow
Logs
49
3. Note the name of the Repository, Integration Service, Folder, Workflow and
mapping for this session run.
50
i. Note that this session was executed by a 32-bit Integration Service, the
name of the node and version of the software.
ii. Note that the commit is target-based and that the commit interval is
10,000. This can be changed on the properties of the session.
iii. Note the SQL Insert Statement for the target and that there is currently
not a primary key on the table, therefore updates are not supported
51
Walkthrough:
1. Scroll down a bit on the log to the START LOAD SESSION section.
Additional
Session Log
Review
2. Note the start of the session and the target table listed.
52
5. Note the Load Summary and the number of inserts, applied, rejected and
affected records.
53
54
Scenario:
Now that you have some experience, your Tech Lead has given you a flawed
workflow that has errors in need of correction.
Objectives:
Learn how to use the PowerCenter interfaces and logs to identify errors.
Duration:
25 minutes
Subject
Review
Lab 3 Troubleshooting
The student will copy a workflow from the DEV_SHARED folder and correct the
errors associated with it.
55
Walkthrough:
Start the
PowerCenter
Repository
Manager
2. PowerCenter will log you into the Repository Manager with the Devxx login
used to log into the Designer.
a. PowerCenter will automatically open your folder.
56
Lab 3 Troubleshooting
Walkthrough:
Copy the
Workflow
i. Click Yes.
Lab 3 Troubleshooting
57
3. Note the Copy Messages in the Output Window of the Repository Manager.
58
Lab 3 Troubleshooting
Walkthrough:
Rename the
Mapping
Walkthrough:
Start the
Workflow
Manager
1. If you are not already logged into the Workflow Manager, launch the application
by clicking on the respective icon in the toolbar.
a. Log into the Repository with your Devxx login.
i. Open your folder.
2. Navigate to the Workflow Designer using the Workflow Tools Toolbar.
a. If a workflow exists on the workspace, use menu option Workflows
Close to clear the workspace.
3. Refresh your folder.
a. Right-Click on your folder and select Disconnect.
b. Right-Click on your folder and select Open.
i. Note that the wf_m_errors1_xx workflow is now listed in your folder
Lab 3 Troubleshooting
59
Walkthrough:
Rename the
Workflow
60
Lab 3 Troubleshooting
Walkthrough:
Trouble
Shoot a
Session
Failure
Lab 3 Troubleshooting
61
62
Lab 3 Troubleshooting
c. Most of the entries are informational; however, take special note of the three
error messages toward the end of the log.
i. These errors indicate that your student logon does not have execute
permission on the EDW connection object.
d. Close the Workflow Log.
Lab 3 Troubleshooting
63
Walkthrough:
Correct the
Session
Failure
After speaking with your team mates and consulting the database, you discover that
the target ODS_TRANSACTIONS exists in your ODS database schema.
4. Navigate back to the Workflow Manager.
5. Edit the Session and click on Mapping Tab.
a. Select Connections on the left side of the interface as shown below:
b. The relational connection for the target is EDW. You must change the
relational connection for the target to your ODS schema, ODSxx.
i. Select the drop down arrow to the right of the ODS_Transactions
Relational target.
ii. The Relational Connection Browser will appear.
iii. Select the ODSxx Connection. Click OK.
64
Lab 3 Troubleshooting
Walkthrough:
Troubleshoot
Second
Failure
Lab 3 Troubleshooting
65
2. The error message indicates that the source file (Transactions.dat) cannot be
found on the server machine at C:\infa_shared\SrcFiles.
a. After checking the server, you see a file called sales_transactions.txt.
b. After a conversation with the team, you determine that the source file should
indeed be changed to sales_transactions.txt.
c. Navigate back to the Workflow Manager.
i. Edit the session s_m_Errors1_xx.
ii. Click the Mapping Tab. Then select SQ_Transactions in the Sources
folder of navigator on the Mapping Tab.
iii. In the Properties Window at the bottom right, note that the value for the
Source FileName is Transactions.dat
66
Lab 3 Troubleshooting
a. Click OK.
b. Save the Repository.
c. Start the Workflow.
Lab 3 Troubleshooting
67
Walkthrough:
Troubleshoot
the Third
Failure
68
Lab 3 Troubleshooting
c. Change the Target Load Type to Normal as shown in the figure below.
d. Click OK.
3. Save the Repository.
4. Start the Workflow
Lab 3 Troubleshooting
69
70
Walkthrough:
Success!!
Congratulations!
Lab 3 Troubleshooting
Scenario:
The staging area for Mersche Motors data warehouse has a customer contacts
table. Mersche Motors receives new data from their regional sales office daily in the
form of three text files. The text files are identical. For processing simplicity,
Mersche Motors will be making use of the PowerCenter ability to read a list of files
from a single source.
Objectives:
Create a filter transformation to eliminate unwanted rows form a flat file source.
Use the DECODE function as a small lookup to replace values for incoming
data before writing to target.
Create a session task that will accept and process a file list as a source.
Create a workflow
Duration:
60 minutes
Subject
Review
PowerCenter will source from a file list. This file list contains the names of three
delimited flat files from the regional sales offices. All rows with a customer number
99999 will need to be filtered out. There are a number of columns that will need to
have the data reformatted, this will include substrings, concatenation and decodes.
71
Walkthrough:
Create a Flat
File Source
Definition
1. If you are not already in the PowerCenter Designer Tool, please start it
according to the instructions in Lab 2.1
a. Log into the Repository with your Devxx login.
b. Open your folder.
c. Open the Source Analyzer workspace and select Clear All.
i. Import the customer_layout.dat flat file definition. This file is located in
the C:\Infa_Shared\SrcFiles directory. If the file is located in a different
directory, your instructor will specify.
d. Ensure that the following parameters are selected:
i. Import field names from the first line.
ii. Comma delimited flat file.
iii. Text Qualifier is Double Quotes
iv. Format of the Date field is Datetime.
e. Confirm that your source definition appears as displayed in the following
figure:
Note: Only one flat file definition is required when using a file list as a source in
PowerCenter. All the files that make up the file list must have the same identical
layout in order for the file list to be successfully processed by PowerCenter.
f.
72
Walkthrough:
Create a
Relational
Target
Definition
73
Walkthrough:
Create a
mapping
Walkthrough:
Create a
Filter
It has been determined that there are certain erroneous records that exist at the
source that should be filtered out of the data stream so that they dont get
loaded to the target.
The data condition to be tested for? Records with a customer number of 99999
or records with null customer numbers.
The Filter transformation is the perfect object for this operation. If your source
were relational, you could use the Source Filter on the Source Qualifier
transformation to achieve the same results.
74
1. Select the Filter transformation tool button located on the Transformation tool
bar and place it in the workspace between the Source Qualifier and the Target.
The icon is shown highlighted below:
2. Link the following ports from the Source Qualifier (SQ_customer_layout) to the
Filter:
CUSTOMER_NO
FIRSTNAME
LASTNAME
ADDRESS
CITY
STATE
ZIP
COUNTRY
PHONE_NUMBER
GENDER
INCOME
EMAIL
AGE
75
c. Click the dropdown arrow for the Filter Condition Transformation Attribute to
active the Expression Editor.
d. Remove the TRUE condition from the Expression Editor.
e. Enter the following expression:
i. CUSTOMER_NO != 99999 OR ISNULL(CUSTOMER_NO)
ii. Click OK to return to the Properties of the Filter transformation
76
f.
g. Click OK.
Walkthrough:
Create an
Expression
2. Select the following ports from the Filter transformation and pass them to the
Expression transformation:
FIRSTNAME
LASTNAME
PHONE_NUMBER
GENDER
AGE
77
Datatype
Precision
Expression
OUT_CUST_NAME
String
41
IN_FIRSTNAME || || IN_LASTNAME
Note: This new port will concatenate the FIRSTNAME and LASTNAME ports into a
single string. Do not use the CONCAT in expressions. Use || to achieve
concatenation. The CONCAT function is available for backward compatibility.
Velocity Best Practice: Prefixing input only ports with IN_ and output ports with
OUT_ is a Velocity Best Practice. This makes it easier to tell what the ports are
without having to open the transformation.
78
Port Name
Datatype
Precision
Expression
OUT_CUST
_PHONE
String
14
'(' ||
SUBSTR(TO_CHAR(in_PHONE_NUMBER
), 1, 3) || ') ' ||
SUBSTR(TO_CHAR(in_PHONE_NUMBER
), 4, 3) || '-' ||
SUBSTR(TO_CHAR(in_PHONE_NUMBER
), 7, 4)
The expression above uses nesting to call the TO_CHAR function from within the
SUBSTR function. The TO_CHAR function is performed first. The SUBSTR
function is then performed against the return value from TO_CHAR.
f.
Port Name
Datatype
Precision
Expression
OUT_GENDER
String
Port Name
Datatype
Precision
Expression
OUT_AGE_GROUP
String
10
The DECODE function used in this previous expression can be used to replace
nested IIF functions or small static lookup tables. The DECODE expression in the
previous step will return the value MALE if the incoming port GENDER is equal to
M, FEMALE if GENDER equals F, or UNK if GENDER equals anything besides F
or M.
This DECODE function assigns the appropriate age group level to each customer
based on their age. DECODE used in this manner tests multiple columns and
conditions, evaluated in a top to bottom order for TRUE or FALSE.
Lab 4.1 m_STG_Customer_Contacts_xx
79
h. Click OK.
4. Link the Expression Transformation to the target.
exp_FORMAT_NAME_GENDER_PHONE
SC_STG_CUSTOMER
AGE
CUST_AGE
OUT_CUST_NAME
CUST_NAME
OUT_CUST_PHONE
CUST_PHONE_NMBR
OUT_GENDER
CUST_GENDER
OUT_AGE_GROUP
CUST_AGE_GROUP
80
fil_CUSTOMER_NO_99999
SC_STG_CUSTOMER
CUSTOMER_NO
CUST_ID
ADDRESS
CUST_ADDRESS
CITY
CUST_CITY
STATE
CUST_STATE
ZIP
CUST_ZIP
COUNTRY
CUST_COUNTRY
INCOME
CUST_INCOME
CUST_E_MAIL
81
Walkthrough:
1. Launch the Workflow Manager and sign into your assigned folder.
Create and
run the
workflow
Note: The source instance you are reading is known as a File List. It is a list of files
which will be appended together and treated as one source file by PowerCenter.
The name of the text file that is listed in Properties | Attributes | Source Filename
will be a text file that contains a list of the text file(s) to be read in as individual
sources. When you create a file list you open a blank text file with an application
such as Notepad and type on a separate line each text file that is to be read as part
of the file list. You may precede each file name with directory path information. If
you dont provide the directory path, PowerCenter assumes the files will be located
in the same directory as the file list file.
i. In Properties | Attribute | Source Filetype, click the dropdown arrow and
change the default from Direct to Indirect.
Note: When you use the file list feature in PowerCenter you have to set Properties |
Attributes | Source Filetype to Indirect so that PowerCenter will understand to read
this file as a list and not as a direct source.
g. Your screen should appear similar to the figure below:
82
The file list used in this exercise lists three text files which are found in the default
location of the file list file, $PMSourceFileDir\. The figure below displays the
contents of customer _list.dat.
83
84
Note: you do not have to type in the qualifiers (i.e. Workflow Name =). These
qualifiers are included in the variable (%w).
85
e. Click OK
i. Optional - Configure an On-Failure email.
f.
Click OK.
86
Walkthrough:
Start the
Workflow
87
Walkthrough:
Check your
email
Walkthrough:
Review the
Data Results
88
1. Preview the target data from the Designer. Your data should appear as
displayed in the figure below:
Walkthrough:
Success!!
Congratulations!
89
90
Scenario:
The staging area for Mersche Motors data warehouse has an Employee information
table. The employee information is saved into three text files daily. The text files
are identical. For processing simplicity, Mersche Motors will be making use of
PowerCenter ability to read a list of files from a single source.
Objectives:
Duration:
30 minutes
Subject Review
PowerCenter will source from a file list. The file list contains the names of three
delimited flat files from the regional sales offices. All rows with a customer number
of 99999 will need to be filtered out. There are a number of columns that will need
to have data reformatted according to the companys business rules. The functions
used to reformat the data include substring, concatenation and decodes.
91
Walkthrough:
Start the
PowerCenter
Designer
1. If you are not already in the PowerCenter Designer Tool, please start it
according to the instructions in Lab 2.1
a. Log into the Repository with your Devxx login.
b. Open your folder.
c. Open the Source Analyzer workspace and select Clear All.
92
93
Walkthrough:
Create a
Relational
Target
Definition
94
Walkthrough:
Create a
Reusable
Transformation
95
96
97
Walkthrough:
Create a
mapping
98
Walkthrough:
Add a Reusable
Expression
Transformation
SC_STG_EMPLOYEES
EMPLOYEE_ID
EMPLOYEE_ID
ADDRESS
EMPLOYEE_ADDRESS
CITY
EMPLOYEE_CITY
STATE
EMPLOYEE_STATE
ZIP_CODE
EMPLOYEE_ZIP_CODE
COUNTRY
EMPLOYEE_COUNTRY
FAX_NUMBER
EMPLOYEE_FAX_NUMBER
EMPLOYEE_EMAIL
NATIVE_LANGUAGE
NATIVE_LANG_DESC
SECOND_LANGUAGE
SEC_LANG_DESC
THIRD_LANGUAGE
TER_LANG_DESC
POSITION_TYPE
POSITION_TYPE
DEALERSHIP_ID
DEALERSHIP_ID
REGIONAL_MANAGER
REGIONAL_MANAGER
DEALERSHIP_MANAGER
DEALERSHIP_MANAGER
HIRE_DATE
HIRE_DATE
DATE_ENTERED
DATE_ENTERED
99
RE_exp_FORMAT_NAME_GENDER
_PHONE
FIRSTNAME
in_FIRSTNAME
LASTNAME
in_LASTNAME
PHONE_NUMBER
in_PHONE_NUMBER
GENDER
in_GENDER
AGE
AGE
RE_exp_FORMAT_NAME_GENDER_PHONE
SC_STG_EMPLOYEES
OUT_NAME
EMPLOYEE_NAME
OUT_PHONE
EMPLOYEE_PHONE_NU
MBER
OUT_GENDER
EMPLOYEE_GENDER
OUT_AGE_GROUP
AGE_GROUP
100
101
Walkthrough:
1. Launch the Workflow Manager and sign into your assigned folder.
a. Create a new workflow called wf_m_STG_EMPLOYEES_ xx.
102
103
f.
Click OK
i. Optional - Configure an On-Failure email.
g. Click OK.
4. Save the workflow.
104
Walkthrough:
Start the
workflow
If your session failed or had errors troubleshoot and correct them by reviewing the
session log and make any necessary changes to your mapping or workflow.
105
Walkthrough:
Check email
106
Walkthrough:
Review the Data
Results
1. Preview the target data from the Designer. Your data should appear as
displayed in the figure below:
107
108
Scenario:
In this lab you will learn and practice some features and techniques that will
increase your efficiency as a PowerCenter Developer.
Objectives:
Duration:
30 minutes
109
Walkthrough:
Arrange All and
Arrange All
Iconic
WARNING: In this lab, do not save your work. While it is normally best practice to
save your work frequently while working in PowerCenter, in this case you will be
making changes to a Mapping that is already the way you want it. So dont save
your work!
1. In the Mapping Designer, if it is not already open, open
m_STG_CUSTOMER_CONTACTS_xx.
2. Right-click and select Arrange All
In a complex Mapping, it can be hard to see how the parts relate. How can you
make this better?
Arrange All is a tool for arranging the transformations in a Mapping neatly.
a. Right-click again and select Arrange All Iconic.
Arrange All Iconic enables you to quickly see the relationships between the objects
in a Mapping.
Walkthrough:
Autolink
110
Walkthrough:
Select Link Path
Suppose another developer has created a large, complex Mapping that is not
working quite right: some data is winding up in the wrong fields. And you have been
asked to debug it. How can you figure out where the data is coming from? Answer:
By tracing the link paths.
1. On the Target definition, right-click the CUST_ZIP_CODE field and select
Select Link Path Backward.
a. The link to the CUST_ZIP_CODE field is now red.
b. Expand the Filter transformation so you can see the related field there.
c. Note that the links leading both into and out of it are red.
d. You can, by expanding the appropriate transformations, trace the lineage of
the CUST_ZIP_CODE field all the way back to the ZIP field in the Source
definition.
Selecting the link path enables you to easily trace the lineage of any field forward
and backward through a Mapping.
Walkthrough:
Propagating Port
Properties
You have to change the datatype of a field in the Source. Do you really have to
manually adjust every port along its link path? No.
2. Edit the Source Qualifier and select the Ports tab.
a. Change the name of the CUSTOMER_NO port to CUST_NO and its
precision from 5 to 10.
b. Click OK.
c. Right-click CUST_NO in the Source Qualifier and select Propagate
Attributes.
d. In the Propagate Port Attributes dialogue:
i. Under "Attributes to Propagate" select Name and Precision, with a
direction of Both.
ii. Click Preview.
iii. Note the green and red arrows. What will be changed?
iv. Click Propagate, then Close.
v. Was a change made in the Filter? What was it?
vi. Was a change made in the Target definition? Why or why not?
111
Walkthrough:
Moving Ports
Sometimes just rearranging the ports on a transformation will make the Mapping
easier to read.
1. Edit the Filter transformation and select the Ports tab.
a. Click the AGE port and use the up arrow ( ) button to move it to the top of
the list of ports.
b. Single-click and hold the number next to the ZIP field. Note the square that
appears in the cursor.
c. Drag ZIP right below AGE.
d. Click Cancel to discard the changes.
Walkthrough:
Transformation
Creation
Click Done.
g. The Filter you just created is already selected. Hold down the Shift key and
click the Aggregator you created to select it, too.
h. Hit the Delete key on your keyboard.
112
i.
Note that the Designer dialogue tells you which transformations will be
deleted.
j.
Click Yes.
Walkthrough:
Reverting to
Saved
Sometimes you make a mistake that you cant easily undo and need to go back to
where you were before. If you havent saved, you can do it.
1. In the Repository Navigator, right-click your folder and select Disconnect.
a. When asked whether to save the changes to your folder, click No.
b. Reopen your folder.
c. If necessary, reopen the Mapping.
d. Note that it is back to the way it was before Step 1.
e. Arrange All for the next step.
Walkthrough:
1. You may not be able to see the whole Mapping in your workspace. But you can.
a. Maximize PowerCenter Developer.
Scaling
Walkthrough:
Switching
Transformations
While Editing
1. When editing several transformations, you dont have to close the Edit
Transformations dialogue and reopen it repeatedly
a. Double-click the Source Qualifier transformation to edit it.
b. Select the Ports tab.
c. In the Select transformation: dropbox, select the Filter transformation.
d. What happens?
113
Walkthrough:
Copy Objects
Within and
Between
Mappings
1. You may find that you want to duplicate a set of transformations within a
Mapping or a Mapplet, preserving the dataflow between them. This technique
may prove useful if you know that you will need to use the logic contained in the
transformations in other Mappings or Mapplets.
a. Arrange All Iconic.
b. Use your left mouse button to draw a rectangle that encloses the Filter and
Expression transformations. This will select these objects.
c. Press Ctrl+C on your keyboard, immediately followed by Ctrl+V.
d. Note that both transformations have been copied onto the mapping,
including the dataflow between them. They have been renamed with a 1
on the end of their names.
e. Open another Mapping.
f.
114
Scenario:
There are two Oracle tables that together contain vital information about the
products sold by Mersche Motors. You will need to combine the data from both
tables into a single staging table that can be used as a source of data for the data
warehouse.
Objectives:
Use a Source Qualifier to define a homogeneous join and view the statement.
Duration:
30 minutes
Subject
Review
PowerCenter will define a homogeneous join between the two Oracle source tables.
That source database server will perform an inner join on the tables based on a join
statement automatically generated by the Source Qualifier. The join set will be
loaded into the staging table.
115
Walkthrough:
Create a
Relational
Source
Definition
1. If you are not already in the PowerCenter Designer Tool, please start it
according to the instructions in Lab 2.1 using your Devxx login.
a. Open the Source Analyzer workspace and select Clear All.
i. Choose the menu option Sources Import from Database.
ii. Connect using the ODBC Data Source SDBU, the username and
password are the same.
iii. Import the relational tables PRODUCT and PRODUCT_COST.
iv. Save your work.
b. Your Source Analyzer workspace should appear as displayed in the figure
below:
116
Walkthrough:
Create a
Shortcut to
the Target
Definition
Walkthrough:
Create a
mapping
The Select Sources for Source Qualifier Transformation dialog box will
appear as shown below:
117
118
Walkthrough:
SQL Select
Statement
e. Click OK twice.
f.
Note: It is generally not a good practice to save the generated SQL unless there is
a need to override it. If you cancel out of the SQL editor, then at runtime the
session will create what is called the default query. This is based on the ports and
their links in the mapping. If you click OK and leave the SQL in the editor window,
youve overridden (hardcoded) the default query. Anytime you want to link a new
port out of the Source Qualifier (or delete a link), you would have to go in and
regenerate the SQL.
119
Walkthrough:
Create and
run the
workflow
1. Launch the Workflow Manager and sign into your assigned folder.
a. If there is a workflow visible in the workspace, close it by selecting
Workflows Close.
2. Create a new workflow called wf_m_STG_PRODUCT_ xx.
120
121
Walkthrough:
Review the
Data Results
122
1. Preview the target data from the Designer. Your data should appear as
displayed in the figure below:
Scenario:
Your Tech Lead has noticed that you are becoming proficient in creating mappings
and workflows using homogeneous joins. He knows of a workflow, currently in a
development state, that has some type of join problem. He has asked you to copy
it from the shared area and correct the issue.
Objectives:
Study the Source Qualifier Transformation and correct the join problem.
Duration:
15 minutes
Subject
Review
123
Walkthrough:
Start the
PowerCenter
Repository
Manager
a. PowerCenter will log you into the Repository Manager with the Devxx login
used to log into the Designer.
b. PowerCenter will automatically open your folder.
124
Walkthrough:
Copy the
Workflow
125
f.
Click Yes.
i. If you receive a conflict message, select Reuse.
ii. Note the Copy Messages in the Output Window of the Repository
Manager.
126
127
Walkthrough:
Rename the
Mapping
Walkthrough:
Refresh the
Workflow
folder
1. If you are not already logged into the Workflow Manager, launch the application
by clicking on the respective icon in the toolbar.
a. Log into the Repository with your Devxx login.
b. Open your folder.
c. Navigate to the Workflow Designer using the Workflow Tools Toolbar.
d. If a workflow exists on the workspace, use menu option Workflows
Close to clear the workspace.
2. Refresh your folder
a. Right-Click on your folder and select Disconnect.
b. Right-Click on your folder and select Open.
c. Note that the wf_Error2_xx are now listed in your folder
128
Walkthrough:
Rename the
Workflow
Walkthrough:
Trouble
Shoot a
Session
Failure
Note: Its possible to look at the First Error Attribute Value and get some direction
on where to look for the problem.
DEALERSHIP. DEALERSHIP _ID = MRKT_EMPLOYEES.DEALERSHIP_ID
seems to be causing the issue.
Lets open the mapping and take a look at the SQL relationship.
129
130
d. Click OK.
e. Save your work to the repository.
131
Walkthrough:
Refresh the
Mapping
c. You should now see a small yellow triangle located on the session object.
This small triangle indicates that the session has been impacted by a
change at the mapping level.
Note: If you do not see an impacted symbol after refreshing the mapping, the
repository automatically refreshed the session for you.
133
Walkthrough:
Start the
Workflow
134
Scenario:
Mersche Motors receives sales transactions data from their regional sales offices in
the form of a text file. The sales transactions data needs to be loaded into the
staging table. The load of the STG_Transactions table uses data from the
relational table STG_Product. Therefore, our workflow must check to ensure the
successful load of the STG_Product table before proceeding with the load of
STG_Transactions.
Objectives:
Study the Joiner Transformation and use it to join two data streams from two
different source types.
Duration:
30 minutes
Subject Review
PowerCenter will source from a flat file and relational table. A Joiner transformation
is used to create one dataflow that is then written to a relational target. The flat file
is missing one field the staging target table needs; the cost of each product. This
value can be read from the STG_PRODUCT table. Each row from the source file
contains a value named Product. This value has an identical corresponding value
in the STG_PRODUCT table PRODUCT_ID column. Use the Joiner transformation
to join the flat file to the relational table (heterogeneous join) using this relationship
and then write the results to the STG_TRANSACTIONS table.
135
Walkthrough:
Create a Flat
File Source
Definition
1. Log into the PowerCenter Designer using your Devxx username and password.
a. Open your folder.
b. Open the Source Analyzer workspace and select Clear All.
2. From the menu, select Sources Import from File.
a. Import the sales_transactions.txt comma delimited flat file.
b. Ensure that the TRANSACTION_DATE is a datetime field.
3. Save the repository
Walkthrough:
Create a
Relational
Source
Definition
Walkthrough:
Create a
Shortcut to the
Target
Definition
136
Walkthrough:
Create a
mapping
Walkthrough:
Create a Joiner
Transformation
1. Select the Joiner transformation from the Transformation toolbar with a single
left click. The figure below shows the Joiner transformation highlighted on the
toolbar:
137
138
Master Property
f.
139
g. Select the Detail drop down box and set it to PRODUCT. Your condition
should be the same as displayed in the figure below:
Note: The Joiner transformation can support multiple port conditions to create a
join. If you need multiple port conditions, simply click the Add a new condition
button to add the other ports that make up the port condition.
h. Click OK.
i.
140
Walkthrough:
Link the Target
Table
1. Link the following ports from the Joiner transformation to the corresponding
columns in the target object.
jnr_SALES_TRANSACTION_STG_PRODUCT
SC_STG_TRANSACTIONS
CUST_NO
CUST_ID
PRODUCT
PRODUCT_ID
DEALERSHIP
DEALERSHIP_ID
PAYMENT_DESC
PAYMENT_DESC
PROMO_ID
PROMO_ID
DATE_ID
DATE_ID
TRANSACTION_DATE
TRANSACTION_DATE
TRANSACTION_ID
TRANSACTION_ID
EMPLOYEE_ID
EMPLOYEE_ID
TIME_KEY
TIME_KEY
SELLING_PRICE
SELLING_PRICE
PRODUCT_COST
UNIT_COST
DELIVERY_CHARGES
DELIVERY_CHARGES
QUANTITY
SALES_QTY
DISCOUNT
DISCOUNT
HOLDBACK
HOLDBACK
REBATE
REBATE
141
Walkthrough:
Create and run
the workflow
1. Launch the Workflow Manager and sign into your assigned folder.
a. If there is a workflow visible in the workspace, close it be selecting
Workflows Close.
2. Open wf_m_STG_PRODUCT_xx.
a. Edit the workflow. Rename it
wf_m_STG_PRODUCT_TRANSACTIONS_xx.
b. Rename the Workflow log to reflect the new workflow name.
c. Click OK.
3. Edit s_m_STG_PRODUCT_xx.
a. In the Mapping Tab
b. Select the truncate target table option for SC_STG_PRODUCT.
142
4. Click on the session task on the Workflow Task toolbar. Click on the Workflow
Designer workspace.
143
d. Click OK.
e. Your workflow should appear similar to the figure displayed below:
144
a. Check the output when to ensure the workflow saved to the repository
successfully.
7. Start the workflow.
a. Review the Workflow Run properties and the Session Statistics.
b. Your information should appear as displayed in the figure below.
145
Walkthrough:
Review the Data
Results
146
1. Preview the target data from the Designer. Your data should appear as
displayed in the figure below:
Scenario:
The Mapping m_STG_DATES_DEBUG contains at least one error that results in
bad data being rejected and not loaded into the target table. You must find and
correct this error so that the data warehouse project can proceed successfully.
Objectives:
Duration:
35 minutes
147
Walkthrough:
Copy and
Inspect the
Debug
Mapping
1. In the Designer application, make sure you are connected and open to your
assigned Devxx folder.
a. Expand the folder Dev_Shared.
i. Locate and select the Mapping m_STG_DATES_DEBUG.
ii. From the menu, select EditCopy.
b. Return to your Devxx folder.
i. Select your Mapping subfolder.
ii. From the menu, select EditPaste.
iii. In the Copy Confirmation dialogue, click Yes.
c. Save the Repository.
Note: Note that the Mapping validates properly. The validation process ensures that
the Mapping is technically valid, but it cannot test for errors in business logic.
d. Open the Mapping in the Mapping Designer workspace.
i. Inspect the Mapping to get an overall idea of what kind of processing is
being done.
ii. Read the expressions in the Expression transformation.
e. You have been told only that there is an error in the data being written to
the target, without any further clarification as to the nature of the error.
Note: Many Mapping errors can be found by carefully inspecting the Mapping,
without using the Debug Wizard. If the error cannot be quickly located in this
manner, the Debug Wizard can help you by showing the actual data passing
through the transformation ports. However, to use the Debug Wizard effectively,
you need to understand the logic of the Mapping.
148
Walkthrough:
Start the
Debugger
Note: If the Debugger Toolbar is not visible, it is possible that another toolbar has
shifted it off the screen. Rearrange the other toolbars until you can see it.
c. EITHER click the Start Debugger button (
Debug Wizard.
d. The first page of the Debug Wizard is informational. Please read it and
press Next.
Note: The Debug Wizard requires a valid Mapping and Session to run it cannot
help you determine why a Mapping is invalid. The Output window of the Designer
will show you the reason(s) why a Mapping is invalid.
149
f.
g. In the Session box, select the Create a debug session radio button.
h. Click Next.
The next page of the Wizard allows you to set connection properties, similar to
creating Sessions in the Workflow Manager application.
i.
j.
150
l.
These panels enable you to set which transformations in the Mapping you wish
to monitor in this debugging session, and set Session configuration information,
such as a parameter file or which connections the variables $Source and
$Target correspond to.
m. Ensure that Discard target data is checked.
n. Click Finish.
Lab 7 The Debugger
151
152
Walkthrough:
Locate the
Error
153
Note that there is no data available as yet the Instance window, with the Next
Instance button, shows data as it moves from transformation to transformation
through the Mapping.
Note that one more row has been read as shown below.
Toggle to the Expression transformation and notice the first row has been pushed
to the Expression transformation and the Target table.
154
f.
Click the Step to Instance button several more times (at least 13), watching
how the data flows from the Instance window to the Target Instance window.
Compare the results between the Target instance and Instance windows.
What is the nature of the error in the data being written to the table?
g. Double-click the Expression transformation to open it.
Note: the transformation properties are grayed-out. While you can view and copy
expressions, you cannot edit the Mapping or its components while the Debugger
session is running.
h. What is causing the error?
155
Walkthrough:
Correct the
Error
Note: Nonetheless, you CAN try new variations on expression while the Debugger
is running.
1. Click the Ports tab.
a. Enter the Expression Editor for one of the output ports preferably the one
that seems likely to be causing the problem.
b. Select the text of the expression (even though it is grayed-out) and copy it to
the Windows clipboard by typing Ctrl+C.
c. Click Cancel twice.
d. Right-click the Expression transformation and select Evaluate Expression.
i. Paste the expression text you chose into the Expression Editor and press
Evaluate.
1. The Debugger will immediately evaluate the expression with the
current data in the ports.
2. You can make as many changes to the Expression here as you need.
3. Once you have a modified expression that you want to keep, copy it
to the Windows clipboard.
e. Close the expression evaluator
f.
) on the
156
Scenario:
Information about Mersche Motors employees is loaded to a relational target table
on a regular basis by an external process. Your tech lead has decided to recreate
that external process using PowerCenter. Sensitive employee data, such as salary
has only now become available for use in the warehouse. It is important that we go
back and update the entire table with this salary information using this new
mapping. This information has been made accessible in text file format. This file
and the EMPLOYEE relational Oracle table can be joined together using the
EMPLOYEE_ID column from each source. A workflow should be created which
will check for the presence of the flat file before executing the load. If the flat file
does not show up in time, an email alert should be sent.
Objectives:
Duration:
45 minutes
Subject
Review
PowerCenter will use a flat file as a lookup for employee salary data and use that
information to update the target ODS_EMPLOYEE table. The session property,
Treat Source Rows As, will be used to update the entire table. Use an Event Wait,
Timer and Email task to ensure flat file is on the server in time and if not, send
email.
157
Walkthrough:
Create a
Shortcut to a
Relational
Source
Definition
1. Log into the PowerCenter Designer using your Devxx username and password.
a. Open your folder.
b. Open the Source Analyzer workspace and select Clear All.
2. Create a shortcut to the relational source, EMPLOYEES. This table will be
found under the SDBU node of the Sources subfolder in DEV_SHARED.
a. Rename it SC_EMPLOYEES.
b. Your source should appear similar to the figure below:
158
Walkthrough:
Create a
Shortcut to a
Relational
Target
Definition
Walkthrough:
Create a
mapping
Walkthrough:
Create a
Lookup
transformation
1. Select the Lookup transformation from the Transformation toolbar with a single
left click. The figure below shows the Lookup transformation highlighted on the
toolbar:
a. Move your mouse pointer onto the Mapping Designer workspace and single
click your left mouse button. This will create a new Lookup Transformation.
159
b. The Select Lookup Table for Lookup Transformation dialog box will appear.
i. Select Import Flat File for the location of the Lookup table.
ii. Locate the c:\infa_shared\SrcFiles directory and select the file salaries.txt.
If the file is located in a different location, the instructor will specify.
160
c. Click Next.
d. Confirm that only the Comma check box under Delimiters is selected.
e. Select the No Quotes option button under Text Qualifier.
f.
Click Next.
g. Confirm that the field names are displayed under Column Information.
These were imported from the first line.
h. Click Finish.
161
i.
e. Click OK.
162
Walkthrough:
Create and run
the workflow
1. Launch the Workflow Manager and sign into your assigned folder.
a. If there is a workflow visible in the workspace, close it be selecting
Workflows Close.
b. Create a new workflow called wf_m_ODS_EMPLOYEES_ xx
i. Edit the s_m_ODS_EMPLOYEES_xx session.
ii. Under the Mapping tab:
1. Set the relational source connection for SQ_SC_EMPLOYEES to
SDBU
2. Set the relational target connection property to ODSxx.
3. Click the lkp_SALARIES lookup under the Transformations subfolder.
4. Ensure the Lookup Source File directory is set to $PMLookupFileDir.
5. Set the Lookup Source Filename to salaries.txt.
163
164
Note: PowerCenters default behavior is to mark each row for Insert. However, that
behavior can be altered. When you change the Treat Source Rows as property to
Update, Integration Service marks all rows to update the target. You can further
define the update operation by adding an update strategy transformation to the
mapping. With an update strategy, you can test each row against a condition, and
then mark each row accordingly; update, insert or delete.
g. Click OK.
165
Walkthrough:
Start the
workflow
166
Walkthrough:
1. Preview the target data from the Designer. Your data should appear as
displayed in the figure below:
Review the
Data Results
Walkthrough:
Add tasks to
the Workflow
It is always a good idea to make sure your sessions are executing as they should
before you add other logic to a workflow. It makes troubleshooting much easier.
Now that we have determined that our session task is executing as expected, we
will add additional workflow tasks to this workflow to ensure that it executes as
expected.
a. Still in the Workflow Manager, select the Event Wait task from the Workflow
Tasks toolbar. The Event Wait task is shown highlighted below:
167
168
d. Select the Timer task from the Workflow Tasks toolbar. The Timer task is
shown highlighted below:
Add a time in which you would like the timer to start. Two minutes from the time
you start the workflow would be best.
g. Select the from the start time of this task radio button.
i. Your screen should look similar to the figure below:
169
j.
2. Select the Email task from the Workflow Tasks toolbar. The Email task is
shown highlighted below:
i. Click OK.
170
a. Click OK.
5. Right-Click on the workspace and select Arrange Horizontal.
a. Your workflow should look similar to the figure below:
171
b. Select the Control task from the Workflow Tasks toolbar. The Control task
is shown highlighted below:
172
173
Walkthrough:
Restart the
Workflow
174
f.
j.
What happens if the control task General Property of Treat Input Links as:
is changed to And?
175
176
Scenario:
There is a workflow in the Dev_Shared area that is failing due to some type of
Lookup Connection error. You have been asked to copy the workflow to your
working folder and troubleshoot the issue. Good Luck!
Objectives:
Duration:
15 minutes
Subject
Review
The student will copy a workflow from the DEV_SHARED folder and correct the
errors associated with it.
177
Walkthrough:
Open the
Repository
Manager
a. PowerCenter will log you into the Repository Manager with the Devxx login
used to log into the Designer.
b. PowerCenter will automatically open your folder.
178
Walkthrough:
Copy the
Workflow
179
i. Click Yes.
e. Note the Copy Messages in the Output Window of the Repository Manager.
f.
180
Walkthrough:
Rename the
Mapping
Walkthrough:
Refresh the
Workflow
Folder
181
Walkthrough:
Rename the
Workflow
Walkthrough:
Trouble
Shoot a
Session
Failure
As stated earlier, if your mapping has more than one target and the value for
connection variable $Target was not been set, the session will fail.
e. Navigate back to the Workflow Manager
183
f.
Note that the $Target Connection Value has not been set
g. Select the small down arrow to the right of the $Target Connection Value
184
185
i. Click OK
ii. Save the Repository
j.
Walkthrough:
Troubleshoot
Connection
Failure #2
Although the error message is different than the last one, it clearly indicates there is
still a problem with $Source or $Target connection variables.
Since we have corrected the $Target problem, we must now take a look at $Source
Variable Connection value.
b. Navigate back to the Workflow Manager
186
Note that the $Source connection value is not set. However, also notice that
ods_sales source does not have a connection!
187
Note that the source is a file, and therefore, uses a file reader. Since the source
does not use a relational connection, $Source cannot be used as the lookup
connection variable.
e. Navigate back to the Connections of the Navigator
After reviewing the multiple databases that are used to load this warehouse, youve
determined that the lookup table is located in the EDW database.
f.
188
j.
189
Walkthrough:
Troubleshoot
Connection
Failure #3
Youve seen this error message before, correct? When there is an index on a
target table, the Target Load Type must be set to Normal. It currently must be set
to Bulk. Remember that you have two targets on this mapping, so be sure to check
both of them.
b. Navigate back to the Workflow Manager
190
191
Walkthrough:
Congratulations!
Success!!
192
Scenario:
The Mersche Motors data warehouse has a date dimension table that needs to be
loaded. The date dimension needs to be loaded before any of the other dimension
tables due to foreign key constraints. The Dates Stage table is loaded with one
record for each date covered in the Operational Data Store (ODS). Each date has
been described with the date attributes used in the ODS, such as the month name,
quarter name, whether the date is a weekday or a weekend and so forth. In this
lab, you will use the Dates Staging table to build a Dates ODS table for the
warehouse. The ODS_Dates table will be used as a persistent lookup cache for
other dimension loads. A primary key for the ODS_Dates table will be assigned
using the Sequence Generator.
Objectives:
Create unique integer primary key values using the NEXTVAL port.
Duration:
20 minutes
Subject
Review
PowerCenter will extract the dates from a shared relational table and load them into
a shared relational target. All columns in the source table have matching columns
in the target table. A primary key for the target table will be assigned using the
Sequence Generator.
193
Walkthrough:
Create a
Shortcut to a
Relational
Source
Definition
1. Log into the PowerCenter Designer using your Devxx username and password.
a. Open your folder.
b. Open the Source Analyzer workspace and select Clear All.
c. Create a shortcut to the relational source, STG_DATES. This table will be
found under the STG node of the Sources subfolder in DEV_SHARED.
i. Rename it SC_STG_DATES.
d. Your source should appear similar to the figure below:
194
Walkthrough:
Create a
Shortcut to a
Relational
Target
Definition
Walkthrough:
Create the
mapping
Walkthrough:
Create a
Sequence
Generator
a. Move your mouse pointer onto the Mapping Designer workspace and single
click your left mouse button. This will create a new Sequence Generator
Transformation.
195
196
Walkthrough:
Link the
Target Table
1. Link all the ports from the Source Qualifier transformation to the corresponding
columns in the target object utilizing the Autolink by Name feature.
Walkthrough:
Create and
run the
workflow
1. Launch the Workflow Manager and sign into your assigned folder.
a. If there is a workflow visible in the workspace, close it by selecting
Workflows Close.
b. Create a new workflow called wf_m_ODS_DATES_ xx.
i. Edit the s_m_ODS_DATES_xx session.
ii. Under the Mapping tab:
1. Set the relational source connection for SQ_SC_STG_DATES to
STGxx.
2. Set the relational target connection for SC_ODS_DATES target to
ODSxx.
3. Set the Target Load Type to Normal.
197
4. Check the property to Truncate the target table option in the target
properties.
c. Save your work.
i. Check the output to ensure the workflow saved to the repository
successfully.
d. Start the workflow.
e. Review the session properties.
f.
198
Walkthrough:
Review the
Data Results
1. Preview the target data from the Designer. Your data should appear as
displayed in the figure below:
199
200
Scenario:
Mersche Motors runs a number of promotions that begin and end on certain dates.
The promotions are stored in the ODS Promotions table. This table also stores the
start and expiring dates as date keys that reference the ODS_DATES table.
However, that data just became available due to the creation of the previous
mapping. We will use the newly created date keys to update the ODS Promotions
table.
Objectives:
Duration:
25 minutes
Subject
Review
The ODS_PROMOTIONS table requires start and expiration date keys. These
exist in the ODS_DATES table that was populated in the previous lab. To obtain
these date keys, which were created by the sequence generator, it will be
necessary to perform a Lookup to the ODS_DATES table in the ODS database.
The ODS_DATES table changes infrequently so it will be loaded into cache in a
persistent state. The lookup cache can be used often by other Mappings that load
ODS tables.
201
Walkthrough:
Create a
Shortcut to a
Relational
Source
Definition
1. Log into the PowerCenter Designer using your Devxx username and password.
a. Open your folder.
b. Open the Source Analyzer workspace and select Clear All.
c. Create a shortcut to the relational source, PROMOTIONS. This table will be
found under the SDBU node of the Sources subfolder in DEV_SHARED.
i. Rename it SC_PROMOTIONS.
d. Your source should appear similar to the figure below:
Walkthrough:
Create a
Shortcut to a
Relational
Target
Definition
202
Walkthrough:
Create the
mapping
203
Walkthrough:
Create
Lookups for
the Start and
Expire Date
Keys
The ODS Dates table was populated by the previous lab, the DATE_KEY was
generated by the seq_ODS_DATES_Date_key Sequence Generator transformation
and DATE_VALUE has a datetype of datetime..
204
iii. You will base the Lookup Condition on the __________________ port
from SQ_SC_PROMOTIONS Source Qualifier and the
________________ column in the ODS_DATES Lookup table.
d. Add a Lookup Transformation to the mapping based on the
SC_ODS_DATES (shortcut to the ODS_DATES) target table.
Click YES to verify the Look up Condition is empty. You will define this
shortly.
205
i.
j.
206
Walkthrough:
Create and
run the
workflow
1. Launch the Workflow Manager and sign into your assigned folder.
a. If there is a workflow visible in the workspace, close it be selecting
Workflows Close.
b. Create a new workflow called wf_m_ODS_PROMOTIONS_ xx.
i. Edit the s_m_ODS_PROMOTIONS_xx session.
ii. Under the Mapping tab:
1. Set the Target Load Type to Normal.
2. Click on Connections in the Navigator.
3. Set the relational source connection for SQ_SC_PROMOTIONS to
SDBU.
4. Set the relational target connection for SC_ODS_PROMOTIONS
target to ODSxx.
c. Set the $Target connection value to ODSXX.
207
Check the output when to ensure the workflow saved to the repository
successfully.
208
i.
j.
209
Walkthrough:
Review the
Data Results
1. Preview the target data from the Designer. Your data should appear as
displayed in the figure below:
210
Scenario:
Mersche Motors management needs a report to determine the total amount each
customer owes the company regardless of where the sale took place. A system
date is also required so that management will know how much the customer owes
on a certain date. Management would also like to get a total of all the orders each
customer has with the company as well.
Objectives:
Duration:
30 minutes
Subject Review
211
Walkthrough:
Create a Source
Definition
Shortcut
Walkthrough:
Create a
Relational
Target
Definition
Walkthrough:
Create the
mapping
212
Walkthrough:
Create a
Lookup
Transformation
213
f.
214
j.
Click OK.
215
Walkthrough:
Create an
Aggregator
Transformation
b. Group by CUST_ID.
c. Add 3 new output ports
i. Output Port #1
1. Name = SUM_UNIT_COST
2. Datatype = Decimal
3. Precision = 35, 2
4. Expression = SUM(UNIT_COST)
5.
ii. Output Port #2
1. Name = SYSTEMDATE
2. Datatype = DateTime
3. Expression = Sysdate
216
217
f.
Walkthrough:
Create and
Execute the
Workflow
1. Launch the Workflow Manager and sign into your assigned folder.
a. Create a new workflow named wf_m_ODS_CUSTOMER_BILLING_xx.
b. Edit the session s_m_ODS_CUSTOMER_BILLING_xx
i. Set the relational connection value for SQ_SC_ODS_CUSTOMER to
ODSxx.
ii. Set the connection value for SC_ODS_CUSTOMER_BILLING target to
ODSxx.
iii. Set the Load Target Type to Normal for the target.
iv. Set the connection value for Multirowlkp_CUSTOMERS_ORDERS to
SDBU.
c. Save your work and start the workflow
218
d. Review the session properties, your information should appear similar to the
figure below:
219
Walkthrough:
Review Data
Results
220
1. Preview the target data from the Designer. Your data should appear as
displayed in the figure below:
Scenario:
The Mersche Motors data warehouse employee table is updated on a daily basis.
Source rows from the transactional area need to be tested to determine if the row
already exists in the dimension table. Rows need to be tagged for update or insert
accordingly. Any rows containing bad data will need to be written to an error file.
Objectives:
Duration:
60 minutes
Subject Review
Lab 9 m_DIM_Employees_xx
221
Walkthrough:
Copy the
Mapping
222
Lab 9 m_DIM_Employees_xx
Walkthrough:
Edit the
Expression
Transformation
Lab 9 m_DIM_Employees_xx
223
3. If that value comes back as not null then, there is a record at the
Target matching the Employee_ID coming in from the Source, so the
record is an update.
ii. Rename the in_EMPLOYEE_ID to Source_EMPLOYEE_ID
1. Note: Source_Employee_ID represents the ID that would come from
the Source, Trans_Employees.
2. The value could come into the lookup as 99999, which would mean it
was null at the source, as determined by our Default Value on the port
in the Expression Transformation. A null coming from the source has
been determined to be an erroneous record.
3. Source_Employee_ID could contain a not null value, which would
mean it is either an insert or update for the DIM_EmployeeTarget.
Logic written in the Groups Tab of the Router Transformation will
determine which it is.
4. Renaming the Target Employee_ID makes the mapping more
readable, however, it will cause PowerCenter to submit an erroneous
SQL statement to the database similar to the following
224
Lab 9 m_DIM_Employees_xx
Lab 9 m_DIM_Employees_xx
225
i.
j.
Click OK.
Walkthrough:
Create a Router
Transformation
The Router Transformation will be used to determine which rows will be inserted,
updated or sent to the error file. This will be done by checking the value of the
EMPLOYEE_ID port.
2. Add a Router Transformation to the mapping:
226
Lab 9 m_DIM_Employees_xx
Lab 9 m_DIM_Employees_xx
227
228
Lab 9 m_DIM_Employees_xx
Walkthrough:
Create an
Update Strategy
for inserted
records
c. Click OK.
Lab 9 m_DIM_Employees_xx
229
Walkthrough:
Create a
Lookup to
DIM_DATES
230
Lab 9 m_DIM_Employees_xx
Lab 9 m_DIM_Employees_xx
231
Walkthrough:
Link Insert
Update Strategy
to Insert Target
d. Click OK.
232
Lab 9 m_DIM_Employees_xx
f.
Walkthrough:
Create Update
Strategy for the
updated record
Lab 9 m_DIM_Employees_xx
233
Walkthrough:
Create Lookup
for Insert Date
Information
The Update portion of your mapping should appear similar to the figure
below:
234
Lab 9 m_DIM_Employees_xx
Walkthrough:
Link Updates
Lookup to
Update Target
c. Click OK.
d. Ensure that DIM_Employee_ID3 is linked to EMPLOYEE_ID of the Target
Transformation, DIM_EMPLOYEES_UPDATES.
Lab 9 m_DIM_Employees_xx
235
f.
236
Lab 9 m_DIM_Employees_xx
Walkthrough:
Link Router
Errors Group to
Error Target
a. Using Autolink
i. Select the ERRORS group of rtr_DIM_EMPLOYEES from the From
Transformation drop down box
ii. Select DIM_EMPLOYEES_ERR from the To Transformation box
iii. Select the More>> button and enter a 4 for From Transformation Suffix.
iv. The Autolink dialog should appear similar to the figure below:
b. Click OK.
Lab 9 m_DIM_Employees_xx
237
238
Lab 9 m_DIM_Employees_xx
Walkthrough:
1. Launch the Workflow Manager and sign into your assigned folder.
Note: To create a flat file as a target instead of the original table, simply
change the Writers type from Relational to File. A fixed width flat file
based on the format of the target definition will be created
automatically. The properties of this file can also be altered by the
user.
Lab 9 m_DIM_Employees_xx
239
240
Lab 9 m_DIM_Employees_xx
Lab 9 m_DIM_Employees_xx
241
Walkthrough:
Override the
Source Filter
242
Lab 9 m_DIM_Employees_xx
Walkthrough:
Start the
Workflow
b. Check the output when to ensure the workflow saved to the repository
successfully.
c. Start the workflow.
d. Review the session properties.
e. Your information should appear as displayed in the figure below.
f.
Lab 9 m_DIM_Employees_xx
243
Walkthrough:
Review the Data
Results
1. Preview the target data from the Designer. Your data should appear as
displayed in the figure below:
Scroll all the way to the right and confirm that the INSERT_DK column was updated
and not the UPDATE_DK column.
Also, you may want to review the three rows that were written to the error file.
Navigate to S:\infa_shared\Tgtfiles or see the instructor for the location of the files.
If the server is running on UNIX, you may need special permission from your
administrator to see the files.
244
Lab 9 m_DIM_Employees_xx
Walkthrough:
Execute the
Workflow for a
Second Time
Lab 9 m_DIM_Employees_xx
245
d. Review the DIM_EMPLOYEES target data from the Designer. Scroll to the
far right of the data screen and notice that there are now entries for
UPDATE_DK and new entries at the bottom of the list for INSERT_DK.
246
Lab 9 m_DIM_Employees_xx
Scenario:
Mersche Motors dealerships sometimes give aggressive discounts that are outside
the authorized range. These type of discounts are a small percentage compared to
the number of rows being processed but the information needs to be processed
accordingly. Also, even though the source dimension table contains 7 days of data
this production execution will load the entire dimension table into the SALES_FACT
table in a single workflow.
Objectives:
Duration:
35 minutes
Subject Review
247
Walkthrough:
Copy the
Mapping
1. Log into the PowerCenter Designer using your Devxx username and password.
a. Open your folder.
b. Navigate to the Mapping Designer using the Designer Tools Toolbar.
c. If a mapping is visible in the workspace, close it by selected menu option
Mappings Close.
d. Copy m_FACT_SALES_xx partial mapping from the DEV_SHARED folder
to your student folder.
e. Rename the new mapping m_ FACT_SALES_xx using your student
number.
f.
j.
248
249
Walkthrough:
Edit the Lookup
d. Click OK.
250
Walkthrough:
Create a
Mapping
Parameter
251
e. Click OK.
f.
252
Walkthrough:
Create an
Unconnected
Lookup
2. Name the new port IN_PROMO_ID and make it an input only port.
3. Make DISCOUNT the return port.
4. Uncheck the Output ports for all other ports except PROMO_ID and
DISCOUNT.
253
254
Walkthrough:
Add
Unconnected
Lookup Test
b. If the IN_DISCOUNT port has a value greater that the value passed in via a
mapping parameter, then we need to get an acceptable value from the
DIM_PROMOTIONS table. The variable port v_DISCOUNT will be used to
hold the return value. Edit the v_DISCOUNT variable port and add the
expression:
IIF(IN_DISCOUNT > $$MAX_DISCOUNT,
:LKP.LKP_DIM_PROMOTIONS(PROMO_ID), IN_DISCOUNT)
The discount is held as a whole number. We need to change this to a
percentage and apply it against the selling price to derive the dollar value of the
discount. Edit the output port OUT_DISCOUNT and add the expression:
V_DISCOUNT / 100 * SELLING_PRICE
Walkthrough:
Create an
Aggregator
Transformation
255
e. Open the Aggregator and re-order the key ports in the following order:
i. CUST_ID
ii. PRODUCT_KEY
iii. DEALERSHIP_ID
iv. PAYMENT_ID
v. PROMO_ID
vi. DATE_KEY
f.
256
Port Name
OUT_UNITS_SOLD
Datatype
Decimal
Precision
Expression
SUM(IN_SALES_QTY)
257
OUT_REVENUE
Datatype
Decimal
Precision
15,2
Expression
SUM((IN_SELLING_PRICE *
IN_SALES_QTY) - DISCOUNT HOLDBACK - REBATE)
i.
258
Port Name
OUT_COST
Datatype
Decimal
Precision
15,2
Expression
SUM(IN_UNIT_COST)
The Aggregator ports should be the same as displayed in the figure below:
j.
l.
259
Walkthrough:
Create and run
the workflow
1. Launch the Workflow Manager and sign into your assigned folder.
a. If there is a workflow visible in the workspace, close it be selecting
Workflows Close.
b. Create a new workflow called wf_m_FACT_SALES_ xx.
i. Edit the s_m_FACT_SALES_xx session.
ii. Under the Mapping tab:
1. Set the relational source connection for
SQ_DIM_TRANSACTIONS_PAYMENT to EDWxx.
2. Set the relational target connection for FACT_SALES target to
EDWxx.
3. Set the Target Load Type to Normal.
4. Set $Target Connection Value to EDWxx.
5. Set your Connections to the entries below:
260
f.
Walkthrough:
Review the Data
Results
1. Preview the target data from the Designer. Your data should appear as
displayed in the figure below:
261
262
Scenario:
The Team Lead has noticed that there are other situations where we can reuse
some of the transformations developed in the FACT_SALES mapping.
Objectives:
Duration:
10 minutes
Subject
Review
263
Walkthrough:
Create the
Mapplet
i. lkp_DIM_PROMOTIONS
ii. lkp_DIM_PRODUCT
iii. lkp_DIM_DATES
iv. exp_DISCOUNT_TEST
v. agg_FACT_SALES
b. Select Edit Copy or the Ctrl+C.
c. Open the Mapplet Designer. Create a mapplet named mplt_AGG_SALES.
i. Select Edit Paste or the Ctrl+V.
ii. Right-Click in the workspace and Arrange All.
iii. Select the Scale to Fit icon.
d. Your mapplet definition should look the same as the figure below:
f.
264
j.
Notice that the mapplet is invalid. Scroll through the messages in the output
window. They point to the expression exp_DISCOUNT_TEST as having an
invalid symbol reference. The reference to the parameter
$$MAX_DISCOUNT is invalid as it does not exist within the mapplet
parameter definition.
Note: Mapping parameters and variables that are created in a mapping are
not available for use in the mapplet that is called from the mapping.
Walkthrough:
Create a new
Mapplet
Parameter
265
Walkthrough:
Add the
Mapplet to
the Mapping
266
Scenario:
Mersche Motors management wants to be able to analyze how certain promotions
are performing. They want to be able to gather the promotions by day for each
dealership for each product being sold. The data warehouse now has the perfect
architecture to deliver that information.
Objectives:
Duration:
120 minutes
Subject
Review
The instructions will provide enough detail for you to design and build the mapping
necessary to load the promotions aggregate table. It is suggested that you use the
Velocity best practices that have been discussed during the course. The workshop
will provide mapping specification documents that can be to design the mapping. If
you are unclear on any instructions, please ask the instructor.
Lab 11 m_FACT_Promotions_Agg_Daily_xx
267
Source System(s):
Target System(s):
Initial Rows:
Rows/Load:
Short Description:
Load Frequency:
Preprocessing:
Post Processing:
Error Strategy:
Reload Strategy:
Unique Source
Fields (PK):
Dependant Objects
268
Lab 11 m_FACT_Promotions_Agg_Daily_xx
SOURCES
Tables
Table Name
System/Schema/Owner
Selection/Filter
File Location
Fixed/Delimited
Files
File Name
Additional File
Info
TARGETS
Tables
Schema Owner
Table Name
Update
Delete
Insert
Unique Key
Files
File Name
File Location
Fixed/Delimited
Lab 11 m_FACT_Promotions_Agg_Daily_xx
269
LOOKUPS
Lookup Name
Table
Location
Match Condition(s)
Persistent / Dynamic
Filter/SQL Override
Source
Target
270
Target
Column
Data
type
Source
System/
Table
Source
Column
Data
type
Expression
Lab 11 m_FACT_Promotions_Agg_Daily_xx
Default
Value if
Null
Data
Issues/
Quality
Walkthrough:
Workshop
Details
Lab 11 m_FACT_Promotions_Agg_Daily_xx
271
c. Target: FACT_PROMOTIONS_AGG_DAILY
i. This relational is located in the EDWxx schema. After executing the
mapping, it should contain 1,073 records. See the figure below for the
target table layout:
Walkthrough:
Mapping
Details
1. In order to successfully create the mapping, you will need to know some
additional details.
a. The management has decided they dont want to keep track of the Manager
Discount or the Employee Discount (PROMO_ID 105 and 200) so these will
need to be excluded from the load.
b. The PRODUCT_KEY can be obtained from the DIM_PRODUCT table by
matching on the PRODUCT_ID.
c. The DATE_KEY can be obtained for the DIM_DATES table by matching the
TRANSACTIONS_DATE to the DATE_VALUE.
d. UNITS_SOLD is derived by summing the QUANTITY.
e. REVENUE is derived by taking the QUANTITY times the SELLING_PRICE
and then subtracting the DISCOUNT, HOLDBACK and REBATE.
272
Lab 11 m_FACT_Promotions_Agg_Daily_xx
i. Most of the discounts are valid but occasionally they may be higher than
the acceptable value of 17.25. When this occurs, you will need to obtain
an acceptable value based on the PROMO_ID. The acceptable value
can be obtained from the DIM_PROMOTIONS table by matching the
PROMO_ID.
ii. The DISCOUNT is a percentage stored as a number. To calculate the
actual discount in dollars, you will need to divide the DISCOUNT by 100
and multiply it by the SELLING_PRICE.
f.
Walkthrough:
Execution
Details
1.
2.
3.
1. Review the session properties, your information should appear similar to the
figure below:
Lab 11 m_FACT_Promotions_Agg_Daily_xx
273
Walkthrough:
Review Data
Results
274
1. Preview the target data from the Designer. Your data should appear as
displayed in the figure below:
Lab 11 m_FACT_Promotions_Agg_Daily_xx
Scenario:
Mersche Motors tech lead has indicated that all staging tables need to be loaded in
a single workflow.
Objectives:
Duration:
60 minutes
Subject
Review
The instructions will provide enough detail for you to design and build the workflow
necessary to load all staging table in a single run. It is suggested that you use the
Velocity best practices that have been discussed during the course. If you are
unclear on any instructions, please ask the instructor.
Lab 12 wf_Load_All_Staging_Tables_xx
275
Source System(s):
Target System(s):
Initial Rows:
Rows/Load:
Short Description:
Load Frequency:
Preprocessing:
Post Processing:
Error Strategy:
Reload Strategy:
Unique Source
Fields (PK):
Dependant Objects
276
Lab 12 wf_Load_All_Staging_Tables_xx
SOURCES
Tables
Table Name
System/Schema/Owner
Selection/Filter
File Location
Fixed/Delimited
Files
File Name
Additional File
Info
TARGETS
Tables
Schema Owner
Table Name
Update
Delete
Insert
Unique Key
Files
File Name
File Location
Fixed/Delimited
Lab 12 wf_Load_All_Staging_Tables_xx
277
LOOKUPS
Lookup Name
Table
Location
Match Condition(s)
Persistent / Dynamic
Filter/SQL Override
Source
Target
278
Target
Column
Data
type
Source
System/
Table
Source
Column
Data
type
Expression
Lab 12 wf_Load_All_Staging_Tables_xx
Default
Value if
Null
Data
Issues/
Quality
Walkthrough:
Workshop
Details
1. Mapping Required
a. This section contains a list of the mappings that will be used in the
workflow
1. m_STG_PAYMENT_xx
2. m_STG_PRODUCT_xx
3. m_STG_DEALERSHIP _xx
4. m_STG_CUSTOMER_CONTACTS_xx
5. m_STG_TRANSACTIONS_xx
6. m_STG_EMPLOYEES_xx
Walkthrough:
Workflow
Details
If any of the previous session fails, then an email should be sent to the
administrator and the workflow aborted.
Lab 12 wf_Load_All_Staging_Tables_xx
279
280
There is more than one solution to the workshop. You will know that
your solution has worked when all of the sessions have completed
successfully.
Lab 12 wf_Load_All_Staging_Tables_xx