Вы находитесь на странице: 1из 10

BANGALORE TECHNICAL TRAININGS Onlinetrainingsbglr@gmail.com +9 !

" #"$%#

Lab &
Basic Lookup

Lab at a Glance................................................................$ Objectives..............................................................2 Summary................................................................2 Duration.................................................................2 E'ercises..........................................................................( Exercise 1: Create the Mapping.............................3 Exercise 2: Create an !un the "or#$%o&..............' Re)erence* Connecte+ ,s -nconnecte+ Loo./0s..... %

PowerCenter 9.x Level I Developer Lab Guide

8-1

Lab 8. Basic Loo up

Lab at a Glance
The exercises in this lab are designed to walk the student through the process of using a Lookup transformation.

Ob1ecti2es
After completing the lab, the student will be able to use a Lookup transformation.

S/mmar3
The purpose of this lab is to load an ODS table with records for only those customers who ha e one or more completed, non! cancelled, in oices on record. The data will be extracted from the "#$O"%& table. The %'STO(&) table will be used as the lookup table. The data will be loaded into a target table called ODS*%'STO(&)*A%T"$&. SOURCE+ "#$O"%& TARGET+ ODS*%'STO(&)*A%T"$& The completed mapping should look as follows+

4/ration
This lab should take approximately 40 minutes.

8- !

PowerCenter 9.x Level I Developer Lab Guide

Lab 8. Basic Loo up

E'ercises
E'ercise * Create t5e 6a00ing
Ste0 . Im0ort t5e so/rce table. %lear the Source Analy,er workspace -right!click anywhere in the workspace and select Clear All.. %ontinue to work in the assigned student folder and import the INVOICE relational source table from the SDBU database schema. The source should look as follows+

Ste0 $. Im0ort t5e target. %lear the /arehouse Designer workspace -right!click anywhere in the workspace and select Clear All.. "mport the ODS_CUSTOMER_ACTIVE relational database target table from the TDBUxx database schema. The target should look as follows+

Sa e the repository.

PowerCenter 9.x Level I Developer Lab Guide

8-"

Lab 8. Basic Loo up

Ste0 (. Creating a ma00ing. %reate a mapping called m_ODS_CUSTOMER_ACTIVE_xx. Ste0 ". A++ so/rce an+ target. Add the INVOICE source definition with its respecti e Source 0ualifier to the mapping+

Add the target definition ODS_CUSTOMER_ACTIVE. Sa e the repository. Ste0 7. Create a )ilter trans)ormation. %reate a 1ilter transformation named fil_ODS_CUSTOMER_ACTIVE. Link the following ports from sq_INVOICE to fil_ODS_CUSTOMER_ACTIVE+ CUST_NO, DATE_CLOSED and CANCELED. Add the following filter condition to fil_ODS_CUSTOMER_ACTIVE -on the Properties tab.+
The only invoices that will meet this filter condition contain a date in the DATE_CLOSED column and were not canceled.

NOT (ISNULL (DATE_CLOSED)) AND CANCELED = 0 The mapping should look as follows+

Sa e the repository. Ste0 #. Create a loo./0 trans)ormation. %lick the Look


8- #
p Tra!sfor"atio!

button. 2osition the

PowerCenter 9.x Level I Developer Lab Guide

Lab 8. Basic Loo up

pointer in the workspace and click again. The Sele#t Look appears.
p Ta$le for Look p Tra!sfor"atio!

dialog

Since the CUSTOMER table has not yet been analy,ed or imported as a source or a target, it must be imported now. %lick on the I"port button. &nter the login information needed to connect to the o%$#_so r#e location+

&xpand the SDBU schema and TABLES node, and select the CUSTOMER table+

%lick O& and a Lookup transformation will appear in the workspace. )ename the Lookup transformation lkp_CUSTOMER. Link CUST_NO from fil_ODS_CUSTOMER_ACTIVE to an empty port in lkp_CUSTOMER.
PowerCenter 9.x Level I Developer Lab Guide 8-$

Lab 8. Basic Loo up

Double!click on the header of lkp_CUSTOMER. The E%it Tra!sfor"atio!s dialog box appears. %lick on the Co!%itio! tab and click the A%% a !e' #o!%itio! button+

The Designer will automatically choose the ports to compare ased on the se!uential order of Loo"up ports and #nput ports.

Select CUST_ID and CUST_NO for the condition. %hange the Co!!e#tio! I!for"atio! on the Properties tab to (So r#e:

$ecause the source and loo"up ta les come from the same data ase %schema&' the (Source varia le may e used.

%lick O& to close the E%it Tra!sfor"atio!s dialog box. Sa e the repository.

8- %

PowerCenter 9.x Level I Developer Lab Guide

Lab 8. Basic Loo up

Ste0 !. Lin. t5e target +e)inition.


A toli!k $) !a"e

the lkp_CUSTOMER to

ODS_CUSTOMER_ACTIVE+

"coni,e the mapping, which should look as follows+

Sa e the repository.

PowerCenter 9.x Level I Developer Lab Guide

8-&

Lab 8. Basic Loo up

E'ercise $* Create an+ R/n t5e 8or.)lo9


Ste0 . Create a 9or.)lo9. %reate a workflow called wf_ODS_CUSTOMER_ACTIVE_xx. %reate a session task called s_m_ODS_CUSTOMER_ACTIVE_xx. Double!click on the session task. The E%it Tasks dialog box appears.

Select the Mappi!* tab. "n the #a igation box, select the source S+_INVOICE. 'nder Co!!e#tio!s, click on the down arrow !ati,e_so r#e and click O&. , select

"n the #a igation box, select the target ODS_CUSTOMER_ACTIVE. 'nder Co!!e#tio!s, click on the down arrow select !ati,e_tar*et_xx and click O&. ,

'nder Properties, the Tar*et loa% t)pe should be defaulted to Nor"al. Scroll down to select the Tr !#ate tar*et ta$le optio!.

%lick O& to close the E%it Tasks dialog box.

Link Start to s_"_ODS_CUSTOMER_ACTIVE_xx+

Sa e, alidate and start 'f_ODS_CUSTOMER_ACTIVE_xx. (onitor and re iew the results for s_"_ODS_CUSTOMER_ACTIVE_xx in the /orkflow (onitor.

8- 8

PowerCenter 9.x Level I Developer Lab Guide

Lab 8. Basic Loo up

Ste0 $. ,eri)3 res/lts : session 0ro0erties.


Though not an ideal production solution' this la should produce uni!ue constraint errors. After the )* rows load' some of the su se!uent rows are trying to insert a row with the same "ey. This scenario will e dealt with in later la s.

Ste0 (. ,eri)3 res/lts : session trans)ormation statistics.

Ste0 ". ,eri)3 res/lts : 0re2ie9 +ata.


+ote that only the first few rows are shown here.

PowerCenter 9.x Level I Developer Lab Guide

8-9

Lab 8. Basic Loo up

Re)erence* Connecte+ ,s -nconnecte+ Loo./0s


Like a number of other transformations, Lookups can be configured to be connected or unconnected+

8- 1'

PowerCenter 9.x Level I Developer Lab Guide

Вам также может понравиться