populating time dimension

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 Description Change Author Publish Date 0.1 Initial Draft Upendra Upadhyay 5 th Jun 2011 0.2 Review#1 Amit Sharma 15 th Jun 2011 www.hyperionguru.com www.bispsolutions.com

Upload: amit-sharma

Post on 27-Oct-2014

13.751 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Populating Time Dimension

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 Description Change Author Publish Date 0.1 Initial Draft Upendra Upadhyay 5th Jun 2011 0.2 Review#1 Amit Sharma 15th Jun 2011

www.hyperionguru.com www.bispsolutions.com

Page 2: Populating Time Dimension

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 TITLE PAGE. NO.

1. Introduction of Populating Time Dimension. 03

2. Setting up Data server, Phy sical schema & Logical Schema in Oracle Data Integrator 11g.

04-12

3. Organizing Model in ODI 11g of Source & Target. 13-18

4. Organizing Project & Import Knowledge Module . 19-21

5. Create Interface (mapping) for Source → Target. 22-36

6. Execute session & Validating Target Data. 37-40

www.hyperionguru.com www.bispsolutions.com

Page 3: Populating Time Dimension

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

Page 4: Populating Time Dimension

2.2 Create Data server, Physical & Logical Schema for Source database

Fig. 02 Create New Data Server in Oracle Technology.

www.hyperionguru.com www.bispsolutions.com

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.

Page 5: Populating Time Dimension

Fig. 03 creating data server for source database.

www.hyperionguru.com www.bispsolutions.com

Page 6: Populating Time Dimension

Fig. 04 Specify JDBC Driver & URL.

Fig. 05 Test connection.

Fig. 06 Creating Physical Schema for SRC_ALMBI60STATM.

www.hyperionguru.com www.bispsolutions.com

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.

Page 7: Populating Time Dimension

Fig: 07 Creating Physical Schema for SRC_ALMBI60STATM.

www.hyperionguru.com www.bispsolutions.com

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.

Page 8: Populating Time Dimension

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

www.hyperionguru.com www.bispsolutions.com

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.

Page 9: Populating Time Dimension

Fig. 10 Creating data server for Target.

www.hyperionguru.com www.bispsolutions.com

Page 10: Populating Time Dimension

Fig. 11 Specify JDBC Driver & URL.

Fig. 12 Test connection.

Fig. 13 Creating physical schema for Target data.

www.hyperionguru.com www.bispsolutions.com

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.

Page 11: Populating Time Dimension

Fig. 14 Creating logical 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.

Page 12: Populating Time Dimension

3.0 Organizing Model for Source & Target 3.1 Create New Model Folder & Model:-

Fig. 15 Create New Model Folder.

www.hyperionguru.com www.bispsolutions.com

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.

Page 13: Populating Time Dimension

Fig. 16 Create Model Folder.

www.hyperionguru.com www.bispsolutions.com

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.

Page 14: Populating Time Dimension

Fig. 17 Create New Model for Source Table.

Fig. 18 Creating model for source table.

www.hyperionguru.com www.bispsolutions.com

Page 15: Populating Time Dimension

Fig. 19 Creating model for target data store .

3.2 Create data store for Target:-

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.

3.2 .1 Creating data store for target :-

1. Right click on Model name such as “TRG_ANSFORMATION_EXPRESSION”. 2 select New Datastore.3. Insert Information and then click on Column.4. Click to add column.5. And then save it.

Page 16: Populating Time Dimension

Fig. 20 Creating Target Data Store.

Fig. 21 Creating Target Data Store.

www.hyperionguru.com www.bispsolutions.com

Page 17: Populating Time Dimension

Fig. 22 Add column in Target table.

www.hyperionguru.com www.bispsolutions.com

Click here to add column

Page 18: Populating Time Dimension

4.0 Organizing Project & Import Knowledge Module : 4.1 Create New Project:-

Fig. 23 Creating project.

www.hyperionguru.com www.bispsolutions.com

4.1.1 Creating project :-

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

Page 19: Populating Time Dimension

Fig. 24 Create project for creating mapping.

4.2 Import Knowledge Module:-

www.hyperionguru.com www.bispsolutions.com

5.2.1 Importing knowledge module :-

1. 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.

Page 20: Populating Time Dimension

Fig. 25 Import Knowledge Module.

Fig. 26 List of Knowledge Module

www.hyperionguru.com www.bispsolutions.com

Page 21: Populating Time Dimension

5.0 Create Interface B/W Source → Target. 5.1 Create Interface B/W Source to Target:-

Fig. 27 Creating interface.

www.hyperionguru.com www.bispsolutions.com

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 Window5. Then Apply it & ok and execute in target mode.

Page 22: Populating Time Dimension

5.1.2 Create Interface(mapping) for source target :-

Fig. 28 Creating interface for populating time dimension

www.hyperionguru.com www.bispsolutions.com

Page 23: Populating Time Dimension

Fig. 29 Creating interface for populating time dimension

Fig. 30 Open Property Inspector if not Open.

Fig. 31 Click here to insert query(First select column name and then in Implementation.

www.hyperionguru.com www.bispsolutions.com

Clear here to expression edition.

Page 24: Populating Time Dimension

5.1.3 Mapping Expression : - These are mapping expression, apply one by one.

S.No Column Mapping Expression

1. N_DATE_SKEY TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'YYYYMMDD')

2. D_CALENDAR_DATE SRC_POPULATING_TIME.CALENDAR_DATE

3. N_HALF_CALENDAR CASE WHEN TO_NCHAR(SYSDATE,'MM')>6 THEN 2 ELSE 1 END

4. N_MONTH_CALENDAR CASE WHEN TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'MM')>6 THEN 2 ELSE 1 END

5.

N_QTR_CALENDAR

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

6. N_TRIMESTER_CALENDAR

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

7. N_WEEK_CALENDAR TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'WW')

8. N_YEAR_CALENDAR TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'YYYY')

9. V_DAY_NAME TO_CHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'DAY')

10. N_DAY_OF_MONTH TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'DD')

11. N_DAY_OF_WEEK TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'D')

12. N_DAY_OF_YEAR TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'DDD')

13. V_HALF_PERIOD_NAME TO_CHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'YYYY')||'HALF'||TO_CHAR(CASE WHEN TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'MM') <6 THEN 1 ELSE 2 END)

14. V_MONTH_PERIOD_NAME

TO_CHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'Mon-YYYY')

15. V_QTR_PERIOD_NAME TO_CHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'YYYY')||'-Q'||TO_CHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'Q')

16.V_TER_PERIOD_NAME

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)

17. V_WEEK_PERIOD_NAME TO_CHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'YYYY')||'WEEK'||TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'WW')

18. V_YEAR_PERIOD_NAME TO_NCHAR(SRC_POPULATING_TIME.CALENDAR_DATE,'YYYY')

19. V_CREATED_BY SRC_POPULATING_TIME.CALENDAR_DATE.CREATED_BY

20. D_CREATED_DATE SYSDATE

www.hyperionguru.com www.bispsolutions.com

Page 25: Populating Time Dimension

Fig. 32 N_DATE_SKEY Column Query.

Fig. 33 D_CALENDAR_DATE Column Query

www.hyperionguru.com www.bispsolutions.com

Page 26: Populating Time Dimension

Fig. 34 N_HALF_CALENDAR Column Query

Fig. 35 N_MONTH_CALENDAR Column Query

www.hyperionguru.com www.bispsolutions.com

Page 27: Populating Time Dimension

Fig. 36 N_QTR_CALENDAR Column Query

Fig. 37 N_TRIMESTER_CALENDAR Column Query

www.hyperionguru.com www.bispsolutions.com

Page 28: Populating Time Dimension

Fig. 38 N_WEEK_CALENDAR Column Query

Fig. 39 N_YEAR_CALENDAR Column Query

www.hyperionguru.com www.bispsolutions.com

Page 29: Populating Time Dimension

Fig. 40 V_DAY_NAME Column Query

Fig. 41 N_DAY_OF_MONTH Column Query

www.hyperionguru.com www.bispsolutions.com

Page 30: Populating Time Dimension

Fig. 42 N_DAY_OF_WEEK Column Query

Fig. 43 N_DAY_OF_YEAR Column Query

www.hyperionguru.com www.bispsolutions.com

Page 31: Populating Time Dimension

Fig. 44 V_HALF_PERIOD_NAME Column Query

Fig. 45 V_MONTH_PERIOD_NAME Column Query

www.hyperionguru.com www.bispsolutions.com

Page 32: Populating Time Dimension

Fig. 46 V_QTR_PERIOD_NAME Column Query

Fig. 47 V_TER_PERIOD_NAME Column Query

www.hyperionguru.com www.bispsolutions.com

Page 33: Populating Time Dimension

Fig. 48 V_WEEK_PERIOD_NAME Column Query

Fig. 49 V_YEAR_PERIOD_NAME Column Query

www.hyperionguru.com www.bispsolutions.com

Page 34: Populating Time Dimension

Fig. 50 V_CREATED_BY Column Query

Fig. 51 D_CREATED_DATE Column Query

www.hyperionguru.com www.bispsolutions.com

Page 35: Populating Time Dimension

5.1.4 Flow of data B/W Source to Target: - These value change in IKM SQL Control Append Flow tab.

S.No Name Value Description1. Flow Control False No Primary Key in Target Table

2. Delete all True Every Time load fresh data.

3. Create Table True Create table in Target Because we create table by data store in Model.

Fig. 52 Flow control.

www.hyperionguru.com www.bispsolutions.com

Page 36: Populating Time Dimension

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

Page 37: Populating Time Dimension

Fig. 55 Execution in Operator Navigator.

www.hyperionguru.com www.bispsolutions.com

Page 38: Populating Time Dimension

Fig. 56 Code for Source in Operator Navigator.

Fig. 57 Code for Target in Operator Navigator.

www.hyperionguru.com www.bispsolutions.com

Page 39: Populating Time Dimension

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