You are on page 1of 39

Oracle Data Integrator 11g (11.1.

1)
Hands-On Guide for Populating Time Dimension

Description:
BISP is committed to provide BEST learning material to the beginners, intermediate and advance learners. In the same series, we have prepared a complete end-to-end hands-on guide for populating the time dimension. The Document focuses on how to populate the Time Dimension from the transactional data source. It also demonstrates in details the various date functions. The guide designed considering the reader of the guide is ODI beginners. Download many such videos, student guides, lab guide, case studies and white papers from our blogs. Join our professional training program to learn from experts.

History: Version 0.1 0.2 Description Change Initial Draft Review#1 Author Upendra Upadhyay Amit Sharma Publish Date 5th Jun 2011 15th Jun 2011

www.hyperionguru.com

www.bispsolutions.com

Purpose
This Hands-On Guide designed to show how to populate the time dimension. This tutorial covers steps to create Data server, Physical schema, Logical Schema, Organizing Model in ODI 11g of Source and Target, Organizing Project & Import Knowledge Module, Create Interface (mapping) for Source Target, Execute session and finally validating the data in the Target.

TABLE OF CONTENTS
S.NO 1. 2. 3. 4. 5. 6. TITLE Introduction of Populating Time Dimension. Setting up Data server, Physical schema & Logical Schema in Oracle Data Integrator 11g. Organizing Model in ODI 11g of Source & Target. Organizing Project & Import Knowledge Module. Create Interface (mapping) for Source Target. Execute session & Validating Target Data. PAGE. NO. 03 04-12 13-18 19-21 22-36 37-40

www.hyperionguru.com

www.bispsolutions.com

Populating Time Dimension


Introduction: - In this Example we populate time in various members in dimension. The date functions are used to populate time in various format like Year, Month, Quarter, Week, Day, Day name, Week Name, Year Name and also covert these date in number format. Setting up Data server, Physical schema & Logical schema in ODI 11g 2.1 Context in ODI which we'll use for Physical Schema :

Fig. 01 Context in ODI.

www.hyperionguru.com

www.bispsolutions.com

2.2 Create Data server, Physical & Logical Schema for Source database
2.2.1 Create Data Server for Source. 1. Right click on Technology in Physical Architecture tab in Topology Navigator & click select New Data Server then insert information like Data Server name, Database Username and Password. 2. Insert information in JDBC driver. 3. Test Connection.

Fig. 02 Create New Data Server in Oracle Technology.

www.hyperionguru.com

www.bispsolutions.com

Fig. 03 creating data server for source database.

www.hyperionguru.com

www.bispsolutions.com

Fig. 04 Specify JDBC Driver & URL.

Fig. 05 Test connection. 2.2.2 Create Physical schema for Source database. 1. Right click on data server name such as SRCSG60STATM & select New Physical Schema. 2. Then scroll down schema and select correct user schema & work schema also where temporary table will store during execution & save it.

Fig. 06 Creating Physical Schema for SRC_ALMBI60STATM.

www.hyperionguru.com

www.bispsolutions.com

Fig: 07 Creating Physical Schema for SRC_ALMBI60STATM. 2.2.3 Create Logical Schema for Source database. 1. Right click on Logical Architecture tab in Topology Navigator & select New Technology. 2. Then scroll down schema and select correct physical schema & save it.

www.hyperionguru.com

www.bispsolutions.com

Fig. 08 Create logical schema for source physical schema.

Fig. 09 Create logical schema for source physical schema.

2.3 Create Data server, Physical & Logical Schema for Target
2.3.1 Create Data Server for Target . 1. Right click on Technology in physical architecture tab & select New Data Server then insert information like Data Server name, Database Username & Password. 2. Insert information in JDBC connection like JDBC Driver & JDBC URL. 3. Test Connection.

www.hyperionguru.com

www.bispsolutions.com

Fig. 10 Creating data server for Target.

www.hyperionguru.com

www.bispsolutions.com

Fig. 11 Specify JDBC Driver & URL.

Fig. 12 Test connection. 2.3.2 Create Physical schema for Target. 1. Right click on data server name and select New Physical Schema. 2. Then scroll down schema and select correct user schema & work schema also where temporary table will store during execution & save it.

Fig. 13 Creating physical schema for Target data.


www.hyperionguru.com www.bispsolutions.com

2.3.3 Create Logical Schema for Target. 1. Right click on Logical Architecture tab in Topology Navigator & select New Technology. 2. Then scroll down schema and select correct physical schema & save it.

Fig. 14 Creating logical schema for Target data.

www.hyperionguru.com

www.bispsolutions.com

3.0 Organizing Model for Source & Target

3.1 Create New Model Folder & Model:3.1.1 Create New Model Folder :1. Right click on Model tab in Designer Navigator & select New Model Folder. 2. Insert Name of Model Folder & then save it.

Fig. 15 Create New Model Folder.

www.hyperionguru.com

www.bispsolutions.com

Fig. 16 Create Model Folder. 3.1.2 Create Model for Source:1. Right click on Model Folder name such as Transformation & select New Model. 2. Insert information like Name, Technology, Logical Schema, Action group, Model Folder and then save it.

www.hyperionguru.com

www.bispsolutions.com

Fig. 17 Create New Model for Source Table.

Fig. 18 Creating model for source table.

www.hyperionguru.com

www.bispsolutions.com

3.1.3 Create Model for Target:1. Right click on Model Folder name such as Transformation & select New Model. 2. Insert information like Name, Technology, Logical Schema, Action group, Model Folder and then save it.

Fig. 19 Creating model for target data store .

3.2 Create data store for Target:3.2 .1 Creating data store for target:1. Right click on Model name such as TRG_ANSFORMATION_EXPRESSION.

2 3. 4. 5.

select New Datastore. Insert Information and then click on Column. Click to add column. And then save it.

www.hyperionguru.com

www.bispsolutions.com

Fig. 20 Creating Target Data Store.

Fig. 21 Creating Target Data Store.

www.hyperionguru.com

www.bispsolutions.com

Click here to add column

Fig. 22 Add column in Target table.

www.hyperionguru.com

www.bispsolutions.com

4.0 Organizing Project & Import Knowledge Module :

4.1 Create New Project:4.1.1 Creating project:Right click on Project tab in Designer Navigator & select New Project. 2. Insert name of project & save it.
1.

Fig. 23 Creating project.

www.hyperionguru.com

www.bispsolutions.com

Fig. 24 Create project for creating mapping.

4.2 Import Knowledge Module:5.2.1 Importing knowledge module:Right click on Knowledge Module in Project name such as "Transactional Model" & select Import Knowledge Module. 2. Import Knowledge Module from list of knowledge module.
1.

www.hyperionguru.com

www.bispsolutions.com

Fig. 25 Import Knowledge Module.

Fig. 26 List of Knowledge Module

www.hyperionguru.com

www.bispsolutions.com

5.0 Create Interface B/W Source Target. 5.1 Create Interface B/W Source to Target:5.1.1 Create Interface b/w source to target:1. Right click on Interface in First Folder in Project Name such as Transaction Model & select New Interface. 2. Insert name of interface & select Optimization Context. 3. Open Property Inspector if not open & insert mapping query Implementation. 4. Insert mapping expression in Mapping Editor Window 5. Then Apply it & ok and execute in target mode.

Fig. 27 Creating interface.

www.hyperionguru.com

www.bispsolutions.com

5.1.2 Create Interface(mapping) for source target:-

Fig. 28 Creating interface for populating time dimension

www.hyperionguru.com

www.bispsolutions.com

Fig. 29 Creating interface for populating time dimension

Fig. 30 Open Property Inspector if not Open.


Clear here to expression edition.

Fig. 31 Click here to insert query(First select column name and then Implementation.
www.hyperionguru.com www.bispsolutions.com

in

5.1.3 Mapping Expression :- These are mapping expression, apply one by one.
S.No Column
N_DATE_SKEY D_CALENDAR_DATE N_HALF_CALENDAR N_MONTH_CALENDAR

Mapping Expression
TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'YYYYMMDD') SRC_POPULATING_TIME.CALENDAR_DATE CASE WHEN TO_NCHAR(SYSDATE,'MM')>6 THEN 2 ELSE 1 END CASE WHEN TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'MM')>6 THEN 2 ELSE 1 END CASE WHEN TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'MM')<=3 THEN 1 WHEN TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'MM')>3 AND TO_NCHAR (SRC _POPULATING_TIME.CALENDAR_DATE,'MM')<=6 THEN 2 WHEN TO_NCHAR (SRC_POPULATING _TIME.CALENDAR_DATE, 'MM')>6 AND TO_NCHAR (SRC_POPULATING_TIME.CALENDAR _DATE ,'MM')<=9 THEN 3 ELSE 4 END CASE WHEN TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'MM') <=4 THEN 1 WHEN TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'MM') <=8 AND TO_NCHAR (SRC_POPULATING_TIME.CALENDAR_DATE,'MM') >4 THEN 2 ELSE 3 END TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'WW') TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'YYYY') TO_CHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'DAY') TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'DD') TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'D') TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'DDD') TO_CHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'YYYY')||'HALF'||TO_CHAR(CASE TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'MM') <6 THEN 1 ELSE 2 END) TO_CHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'Mon-YYYY') WHEN

1. 2. 3. 4. 5.

N_QTR_CALENDAR

6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20.

N_TRIMESTER_CALENDA R N_WEEK_CALENDAR N_YEAR_CALENDAR V_DAY_NAME N_DAY_OF_MONTH N_DAY_OF_WEEK N_DAY_OF_YEAR V_HALF_PERIOD_NAME V_MONTH_PERIOD_NAM E V_QTR_PERIOD_NAME

V_TER_PERIOD_NAME V_WEEK_PERIOD_NAME V_YEAR_PERIOD_NAME V_CREATED_BY D_CREATED_DATE

TO_CHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'YYYY')||'-Q'|| TO_CHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'Q') TO_CHAR (SYSDATE,'YYYY')|| '-T' ||TO_CHAR (CASE WHEN TO_NCHAR (SYSDATE, 'MM')<=4 THEN 1 WHEN TO_NCHAR (SYSDATE,'MM')<=8 AND TO_NCHAR(SYSDATE, 'MM')>4 THEN 2 ELSE 3 END) TO_CHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'YYYY')||'WEEK'|| TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'WW') TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'YYYY') SRC_POPULATING_TIME.CALENDAR_DATE.CREATED_BY SYSDATE

www.hyperionguru.com

www.bispsolutions.com

Fig. 32 N_DATE_SKEY Column Query.

Fig. 33 D_CALENDAR_DATE
www.hyperionguru.com

Column Query

www.bispsolutions.com

Fig. 34 N_HALF_CALENDAR Column Query

Fig. 35 N_MONTH_CALENDAR Column Query

www.hyperionguru.com

www.bispsolutions.com

Fig. 36 N_QTR_CALENDAR Column Query

Fig. 37 N_TRIMESTER_CALENDAR Column Query

www.hyperionguru.com

www.bispsolutions.com

Fig. 38 N_WEEK_CALENDAR Column Query

Fig. 39 N_YEAR_CALENDAR Column Query

www.hyperionguru.com

www.bispsolutions.com

Fig. 40 V_DAY_NAME Column Query

Fig. 41 N_DAY_OF_MONTH Column Query

www.hyperionguru.com

www.bispsolutions.com

Fig. 42 N_DAY_OF_WEEK Column Query

Fig. 43 N_DAY_OF_YEAR Column Query

www.hyperionguru.com

www.bispsolutions.com

Fig. 44 V_HALF_PERIOD_NAME Column Query

Fig. 45 V_MONTH_PERIOD_NAME Column Query

www.hyperionguru.com

www.bispsolutions.com

Fig. 46 V_QTR_PERIOD_NAME Column Query

Fig. 47 V_TER_PERIOD_NAME Column Query

www.hyperionguru.com

www.bispsolutions.com

Fig. 48 V_WEEK_PERIOD_NAME

Column Query

Fig. 49 V_YEAR_PERIOD_NAME Column Query

www.hyperionguru.com

www.bispsolutions.com

Fig. 50 V_CREATED_BY Column Query

Fig. 51 D_CREATED_DATE Column Query

www.hyperionguru.com

www.bispsolutions.com

5.1.4 Flow of data B/W Source to Target:- These value change in IKM SQL Control Append Flow tab. S.No 1. 2. 3. Name Flow Control Delete all Create Table Value False True True Description No Primary Key in Target Table Every Time load fresh data. Create table in Target Because we create table by data store in Model.

Fig. 52 Flow control.

www.hyperionguru.com

www.bispsolutions.com

6.0 Execute session & Validating Target Data


6.1 Target data store before execute session :-

Fig. 53 Target Data in ODI Before execute session.

Fig. 54 Target Data in Oracle Before execute session

6.2 Execute Session(Interface and Check it in Operator Navigator) :www.hyperionguru.com www.bispsolutions.com

Fig. 55 Execution in Operator Navigator.

www.hyperionguru.com

www.bispsolutions.com

Fig. 56 Code for Source in Operator Navigator.

Fig. 57 Code for Target in Operator Navigator.


www.hyperionguru.com www.bispsolutions.com

6.3 After Execute Package:-

Fig. 58 Target Data in ODI After execute session.

Fig. 59 Target Data in ODI After execute session.

www.hyperionguru.com

www.bispsolutions.com

You might also like