You are on page 1of 7

Sales Data Warehouse (Informatica) Module 1

Sales Data Warehouse


Assignments Document for Informatica Level 1 Version:-1.0

Business Intelligence Center of Excellence

Page 1 of 7

Sales Data Warehouse (Informatica) Module 1

Table Of Contents
1. INTRODUCTION .....................................................................................................................................3 2. LEARNINGS...............................................................................................................................................3 3. CREATING THE REQUIRED TABLES................................................................................................3 4. POPULATING BRAND MASTER .........................................................................................................4 5. POPULATING CATEGORY MASTER ................................................................................................4 6. POPULATING PRODUCT MASTER.....................................................................................................4 7. POPULATING BRANCH MASTER.......................................................................................................4 8. POPULATING COUNTRY MASTER....................................................................................................4 9. POPULATING SALES MASTER............................................................................................................4 10. POPULATING CITY AND STATE MASTER.....................................................................................5 11. POPULATING CITY DATA USING SQL OVERRIDE.....................................................................5 12. POPULATING THE DIMENSIONS AND FACT ...............................................................................5 13. APPENDIX A............................................................................................................................................5 SEQUENCE SEQ_CATEGORY.................................................................................................................................6 FISCAL CALCULATION.........................................................................................................................................6

Business Intelligence Center of Excellence

Page 2 of 7

Sales Data Warehouse (Informatica) Module 1 .................................................................................................................................................. ..................................................................................................................................................

1. Introduction
This assignment is intended for developers who are new to Informatica. Information on the system is specified in the attachment.

sales_design_applica tion.doc

2. Learnings
After completing the assignments in this document you will have knowledge on the following a. Importing source and target definitions b. Creating source and target definitions c. Source qualifier (also look into sql override) d. Filter transform e. Router transform f. Expression transform g. Update strategy transform h. Lookup transform (also try connected, unconnected lookups) i. Joiner transform j. Sequence generator k. Data loading from fixed record length flat file to table l. Data loading from variable record length flat file to table m. Data loading from table to table Following needs to be done for each transform a. Explore on the different settings that can be done on different transforms b. Validate the transforms c. In the metadata extension enter the functionality of the transform d. Use the debugger Estimated total time for doing all the assignments in this document is around 20 hrs.

3. Creating the Required Tables


Using the following script create the required tables in Oracle database if not already existing.

sales_data.zip

Business Intelligence Center of Excellence

Page 3 of 7

Sales Data Warehouse (Informatica) Module 1

table_creation.SQL

Note: Name mappings like bixxxxx_a_b_c_m_mapping_name Where a is assignment number and b- is question number and c- is sub question numbers Name targets in mappings starting with bixxxxx . So that all log or <.out> files will be crated in same fashion. 4. Populating Brand master
Create a fixed length flat file and load the data into brand master using informatica The data should be truncated before loading.

5. Populating category master


Create a fixed length flat file and load the data into category master using informatica. Insert the data if not existing else update. Reject the records where description is NULL

6. Populating product master


Create a comma delimited flat file and load the data into product master using informatica. Insert the data if not existing else update

7. Populating branch master


Create a fixed length flat file and load the data into branch master using informatica. Load only those branches where branch description is not null. Truncate the data before loading. Try bulk loading and normal loading

8. Populating country master


Create a comma delimited flat file and load the data into country master using Informatica. Insert the data if not existing else update

9. Populating sales master


Create three comma delimited flat files for sales data. Each file should have data for a particular year, the data is available in sales_data.xls, in the sales tab. Load the data into sales master using indirect source files option. Sales_amount from flat file should be stored as sales_amount *

Business Intelligence Center of Excellence

Page 4 of 7

Sales Data Warehouse (Informatica) Module 1 10 in table. Insert the data if not existing else update. Consider (product_id, branch_id, date_of_sales) as primary key.

10. Populating city and state master


Create a flat file (city_state.txt) with data containing city data and state data. The city and state records should be differentiated by record_type_indicator i.e. C for city and S for state. Load corresponding data into city and state tables. Also create some junk records having X as the indicator which should be filtered out. Sort the source data file before loading. Insert the data if not existing else update.

11. Populating city data using SQL override


Delete the data from city_mast table (using Informatica), delete some state records from state_mast table (using update override). Using the data file created in the previous assignment load city data from the flat file into city table. Load only those cities for which the state exists in the state_mast table using SQL override. Use the city_state.txt and state table as the sources. Note :While loading data into Dimension tables, for avoiding Primary Key violation & for identifying rows loaded by you, kindly append the primary key field of each dimension table with your employee id. For example, if you want to load data in DIM_PRODUCT table insert Dim_Key as 10001||-||Sequence_No where 10001 is Employee no.

12. Populating The Dimensions and Fact


1. Populate the product dimension table i.e. dim_product table. To populate the same take data from product_mast, brand_mast and category_mast by joining the appropriate columns, Create the sequence for the product_key. Insert the data if not existing else update it. 2. Populate the geography dimension table i.e. dim_geo table. To populate the same take data from country_mast, state_mast, city_mast and branch_mast. Create the sequence for the geo_key. Insert the data if not existing else update it. 3. Populate time dimension i.e. dim_time table by getting data from just sales table. Insert the record if not existing (no update) 4. Populate the fact table by using all the three dimension tables and one source table. For the fact table i.e. fact_sales table there are product_key, geo_key and time_key coming from 3 dimension tables. Insert the record if not existing else update. Consider product_key, geo_key and time_key as primary key

13. Appendix A

Business Intelligence Center of Excellence

Page 5 of 7

Sales Data Warehouse (Informatica) Module 1 These objects may already exist, Please create only if not existing.

Sequence seq_category
CREATE SEQUENCE seq_category INCREMENT BY 1 START WITH 1 NOMAXVALUE NOMINVALUE;

Fiscal calculation
FUNCTION ctd_get_fiscal_format_fnc(p_date_in IN DATE) return VARCHAR2 AS v_week NUMBER(5); v_month NUMBER(5); v_year NUMBER(5); v_fiscal_format VARCHAR2(7); BEGIN SELECT to_char(p_date_in,'IW') INTO v_week FROM dual; SELECT to_char(to_date(to_char(p_date_in,'IY'),'YY'),'YYYY') INTO v_year FROM dual; IF(v_week <= 5) THEN v_month:= 1; ELSIF(v_week <= 9) THEN v_month:= 2; ELSIF(v_week <= 13) THEN v_month:= 3; ELSIF(v_week <= 18) THEN v_month:= 4; ELSIF(v_week <= 22) THEN v_month:= 5; ELSIF(v_week <= 26) THEN v_month:= 6; ELSIF(v_week <= 31) THEN v_month:= 7; ELSIF(v_week <= 35) THEN v_month:= 8; ELSIF(v_week <= 39) THEN v_month:= 9; ELSIF(v_week <= 44) THEN v_month:= 10; ELSIF(v_week <= 48) THEN v_month:= 11; ELSIF(v_week <= 53) THEN v_month:= 12; END IF; v_fiscal_format:= v_year || '-' || LPAD(v_month,2,'0'); RETURN v_fiscal_format;

Business Intelligence Center of Excellence

Page 6 of 7

Sales Data Warehouse (Informatica) Module 1 EXCEPTION WHEN OTHERS THEN RAISE_APPLICATION_ERROR(-20101,'Error in ctd_business_plan_pkg.ctd_get_fiscal_format_fnc'||SQLCODE||'-'||SUBSTR(SQLERRM,1,500) ); END ctd_get_fiscal_format_fnc;

Business Intelligence Center of Excellence

Page 7 of 7

You might also like