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

Target Table/File name Target Field names Target DataType

CDW_SAPP_D_CUSTOMER CUST_ID Number(10)

CDW_SAPP_D_CUSTOMER CUST_F_NAME VARCHAR2(40)


CDW_SAPP_D_CUSTOMER CUST_M_NAME VARCHAR2(40)
CDW_SAPP_D_CUSTOMER CUST_L_NAME VARCHAR2(40)
CDW_SAPP_D_CUSTOMER CUST_SSN NUMBER(9)
CDW_SAPP_D_CUSTOMER CUST_STREET VARCHAR2(38)
CDW_SAPP_D_CUSTOMER CUST_CITY VARCHAR2(30)
CDW_SAPP_D_CUSTOMER CUST_STATE VARCHAR2(30)
CDW_SAPP_D_CUSTOMER CUST_COUNTRY VARCHAR2(30)
CDW_SAPP_D_CUSTOMER CUST_ZIP NUMBER(7)
CDW_SAPP_D_CUSTOMER CUST_PHONE VARCHAR2(12)
CDW_SAPP_D_CUSTOMER CUST_EMAIL VARCHAR2(40)
CDW_SAPP_D_CUSTOMER CREATED_DATE TIMESTAMP(0)
CDW_SAPP_D_CUSTOMER END_DATE DATE
Description
Surrogate key of the customer table. Used to uniquely identify a row.

First Name of the Customer


Middle Name of the customer
Last Name of the customer
Social Security Number of the customer (National ID)
Apartment no and Street name of customer's Residence
Customers Current City
Customers State code
Customers country code
Zip code of Customer's Country
Contact Number of the customer
Email address of the customer
Record inserted date.
Indicates whether the record is active or not
Mapping Logic Source File Name
System generated based on Customer SSN. -
Insert for new Customer/ expire the old record and
insert the updated record for existing customers
Convert the Name to Title Case CDW_SAPP_CUSTOMER.txt
Convert the middle name in lower case CDW_SAPP_CUSTOMER.txt
Convert the Last Name in Title Case CDW_SAPP_CUSTOMER.txt
Direct move ( Abort the session if SSN is invalid. Convert to CDW_SAPP_CUSTOMER.txt
number )
Concatenate Apartment no and Street name of customer's CDW_SAPP_CUSTOMER.txt
Residence
Direct Movewith comma as a seperator CDW_SAPP_CUSTOMER.txt
Direct Move CDW_SAPP_CUSTOMER.txt
Direct move CDW_SAPP_CUSTOMER.txt
Direct move ( Convert to number ) CDW_SAPP_CUSTOMER.txt
Change the format to xxx-xxx-xxxx CDW_SAPP_CUSTOMER.txt
Direct move CDW_SAPP_CUSTOMER.txt
SYSDATE -
Null on insert / SYSDATE - (1Sec) on update. -
Source File Column Names Source Data Type
- -

FIRST_NAME STRING(40)
MIDDLE_NAME STRING(40)
LAST_NAME STRING(40)
SSN STRING(9)
STREET_NAME,APT_NO STRING(30),String(7)
CUST_CITY STRING(30)
CUST_STATE STRING(30)
CUST_COUNTRY STRING(30)
CUST_ZIP STRING(7)
CUST_PHONE NUMBER(10)
CUST_EMAIL STRING(40)
- -
- -
Target Table/File name Target Field names Target DataType
CDW_SAPP_D_SUPPLIER SUPPLIER_ID NUMBER(10)

CDW_SAPP_D_SUPPLIER SUPPLIER_NAME VARCHAR2(50)


CDW_SAPP_D_SUPPLIER SUPPLIER_SSN NUMBER(9)
CDW_SAPP_D_SUPPLIER SUPPLIER_PHONE VARCHAR2(12)
CDW_SAPP_D_SUPPLIER SUPPLIER_LOC VARCHAR2(30)
Description
Surrogate key for the supplier table. Used to uniquely identify a supplier

Name of the supplier


Social Security Number of the Supplier (Convert to number)
Phone number of the supplier(convert to string)
Location (City) of the Supplier
Mapping logic Source File Name
System generated based on supplier SSN.Insert for new -
supplier/update the entire record for existing suppliers

If a percentage symbol is present in the name of supplier CDW_SAPP_SUPPLIER.txt


remove and load else
Direct move(Abort the direct
sessionmove
if SSN is invalid) CDW_SAPP_SUPPLIER.txt
Standardize the phone number to XXX-XXX-XXXX CDW_SAPP_SUPPLIER.txt
Direct move CDW_SAPP_SUPPLIER.txt
Source File Column Names Source Data Type
- -

SUPPLIER_NAME STRING(50)
SUPPLIER_SSN STRING(9)
SUPPLIER_PHONE NUMBER(10)
SUPPLIER_LOC STRING(30)
Target Table/File name Target Field names Target DataType
CDW_SAPP_D_PRODUCT PRODUCT_CODE NUMBER(10)

CDW_SAPP_D_PRODUCT PRODUCT_NAME VARCHAR2(30)

CDW_SAPP_D_PRODUCT SUPPLIER_ID NUMBER(10)

CDW_SAPP_D_PRODUCT PRODUCT_PRICE STRING(9)


Description Mapping logic
Key supplied from the source system which Insert for new Product/update the entire record for
uniquely identifies a product existing products( Abort the session if SSN is
invalid )
Name of the Product Trim the trailing spaces and load the data

Primary key of the Supplier ( Foreign Key for Join with Supplier table, based on SSN from
this table) Supplier Table
and load the corresponding Supplier ID
Price of the product Direct move
Source File Name Source File Column Names Source Data Type
CDW_SAPP_PRODUCT.txt PRODUCT_CODE NUMBER(10)

CDW_SAPP_PRODUCT.txt PRODUCT_NAME STRING(30)

CDW_SAPP_PRODUCT.txt SUPPLIER_SSN STRING(9)

CDW_SAPP_PRODUCT.txt PRODUCT_PRICE STRING(9)


Target Table/File name Target Field names Target DataType
CDW_SAPP_D_BRANCH BRANCH_CODE NUMBER(9)

CDW_SAPP_D_BRANCH BRANCH_NAME VARCHAR2(25)

CDW_SAPP_D_BRANCH BRANCH_STREET VARCHAR2(30)

CDW_SAPP_D_BRANCH BRANCH_CITY VARCHAR2(30)

CDW_SAPP_D_BRANCH BRANCH_STATE VARCHAR2(30)

CDW_SAPP_D_BRANCH BRANCH_ZIP NUBMER(7)

CDW_SAPP_D_BRANCH BRANCH_PHONE VARCHAR2(13)


Description Mapping logic
Uniquely identifies a branch of the retail store Insert if new Branch/update the entire record for
existing branches
Name of the Branch Direct move

Street Address Direct move

City name where the branch is located Direct move

State name where the branch is located Direct move

Zip postal code(default value 999999) If the source value is null load default value else
Direct move
Phone number of the branch Change the format of phone number to (XXX)XXX-
XXXX
Source File Name Source File Column Names Source Data Type
CDW_SAPP_BRANCH.txt BRANCH_CODE NUMBER(9)

CDW_SAPP_BRANCH.txt BRANCH_NAME STRING(25)

CDW_SAPP_BRANCH.txt BRANCH_STREET STRING(30)

CDW_SAPP_BRANCH.txt BRANCH_CITY STRING(30)

CDW_SAPP_BRANCH.txt BRANCH_STATE STRING(30)

CDW_SAPP_BRANCH.txt BRANCH_ZIP NUMBER(7)

CDW_SAPP_BRANCH.txt BRANCH_PHONE STRING(10)


Target Table/File name Target Field names
CDW_SAPP_D_TIME TIMEID
CDW_SAPP_D_TIME DAY
CDW_SAPP_D_TIME MONTH
CDW_SAPP_D_TIME QUARTER
CDW_SAPP_D_TIME YEAR
Target DataType Description Mapping logic
VARCHAR2(8) The unique key defines a calendar day Direct move
NUMBER(2) Day of a month Get the date part of TIME_ID
NUMBER(2) A month of the current year Get the Month part of TIME_ID
VARCHAR2(8) Specifies a business period Calculate using the MONTH column.
NUMBER(4) Specifies the Year part Get the year part of TIME_ID
Source File Name Source File Column Names Source Data Type
SRC_CALENDER_FILE.txt TIME_KEY STRING(8)
SRC_CALENDER_FILE.txt TIME_KEY STRING(8)
SRC_CALENDER_FILE.txt TIME_KEY STRING(8)
SRC_CALENDER_FILE.txt TIME_KEY STRING(8)
SRC_CALENDER_FILE.txt TIME_KEY STRING(8)
Target Table/File name Target Field names Target DataType
CDW_SAPP_STG_SALES CDW_P_SALES_DSET_KEY NUMBER(9)
CDW_SAPP_STG_SALES SALES_F_PERIOD_KEY VARCHAR2(8)
CDW_SAPP_STG_SALES SALES_F_PERIOD_KEY VARCHAR2(8)
CDW_SAPP_STG_SALES SALES_F_PERIOD_KEY VARCHAR2(8)
CDW_SAPP_STG_SALES SALES_F_CUSTOMER_KEY NUMBER(10)
CDW_SAPP_STG_SALES SALES_F_SUPPLIER_KEY NUMBER(10)
CDW_SAPP_STG_SALES SALES_F_BRANCH_CODE NUMBER(9)
CDW_SAPP_STG_SALES SALES_F_BRANCH_NAME VARCHAR2(25)
CDW_SAPP_STG_SALES SALES_F_PRODUCT_CODE NUMBER(10)
CDW_SAPP_STG_SALES SALES_F_PRODUCT_NAME VARCHAR2(30)
CDW_SAPP_STG_SALES SALES_SOLD_QTY NUMBER(7)
CDW_SAPP_STG_SALES SALES_TOTAL_AMOUNT NUMBER(8,2)
CDW_SAPP_STG_SALES CREATED_DATE TIMESTAMP(0)
CDW_SAPP_STG_SALES CREATED_BY VARCHAR2(40)

Target Table/File name Target Field names Target DataType


CDW_SAPP_ERR CDW_P_SALES_DSET_KEY NUMBER(9)
CDW_SAPP_ERR ERROR_CODE NUMBER(9)
CDW_SAPP_ERR ERR_MSG VARCHAR2(100)
CDW_SAPP_ERR ERR_COLUMN_NM VARCHAR2(25)

Use the below logic for ERROR table load

1. If the price of the product contains any string or $


value record need to be flagged and routed to the
error table.

2. If the sale date (time key is null) from lookup


record need to be moved in to error table.
3. If the quantity is in Null record need to be marked
as an error.
Description
Surrogate key for the fact table
Surrogate key of the period(time) table
Surrogate key of the period(time) table
Surrogate key of the period(time) table
surrogate key of the customer dim table
surrogate key of the supplier dim table
Surrogate key of the branch table
Branch name in which the was product sold
Product code
Name of the product sold
Quantity of product sold
Total amount
Load date
The workflow name

Description
Identifies the record in which the error ocured
uniquely identifies the error record
Defines the Error
Column name in which the error occurred
Mapping logic
seq NUMBER
Look up from Time dim table and load the TIMEID
Look up from Time dim table and load the TIMEID
Look up from Time dim table and load the TIMEID
look up from customer dim table.
look up from supplier dim table
Look up Branch Code using Branch name from the Location Dimension Table
Direct move
Look up Product Code using Product Name from the Product Dimension Table
Direct move
Direct move from the file/check for decimal values
Need to be calculated from the product table data (Price of product and sales_qty).
sysdate
workflow name

Mapping logic
Need to load the primary key of record (CDW_P_SALES_DSET_KEY) in which error o
Generate the Error code based on the error.
Decode the Error code and set a relavent message
Load the name of the column in which has error
Source File Name Source File Column Names Source Data Type
- - -
CDW_SAPP_F_SALES_BR_XX DAY NUMBER(2)
CDW_SAPP_F_SALES_BR_XX MONTH NUMBER(2)
CDW_SAPP_F_SALES_BR_XX YEAR NUMBER(4)
CDW_SAPP_F_SALES_BR_XX CUSTOMER_SSN NUMBER(9)
CDW_SAPP_F_SALES_BR_XX SUPPLIER_SSN NUMBER(9)
CDW_SAPP_F_SALES_BR_XX BRANCH_NAME STRING(25)
CDW_SAPP_F_SALES_BR_XX BRANCH_NAME STRING(25)
CDW_SAPP_F_SALES_BR_XX PRODUCT_NAME STRING(30)
CDW_SAPP_F_SALES_BR_XX PRODUCT_NAME STRING(30)
CDW_SAPP_F_SALES_BR_XX QUANTITY_SOLD NUMBER(7)
CDW_SAPP_F_SALES_BR_XX QUANTITY_SOLD NUMBER(7)
CDW_SAPP_F_SALES_BR_XX NA NA
CDW_SAPP_F_SALES_BR_XX NA NA

Source File Name Source File Column Names Source Data Type
- - -
- - -
- - -
CDW_SAPP_F_SALES_BR_XX - -
Target Table/File name Target Field names Target DataType
CDW_SAPP_STG_SALES CDW_P_SALES_DSET_KEY NUMBER(9)
CDW_SAPP_STG_SALES SALES_F_PERIOD_KEY VARCHAR2(8)
CDW_SAPP_STG_SALES SALES_F_PERIOD_KEY VARCHAR2(8)
CDW_SAPP_STG_SALES SALES_F_PERIOD_KEY VARCHAR2(8)
CDW_SAPP_STG_SALES SALES_F_CUSTOMER_KEY NUMBER(10)
CDW_SAPP_STG_SALES SALES_F_SUPPLIER_KEY NUMBER(10)
CDW_SAPP_STG_SALES SALES_F_BRANCH_CODE NUMBER(9)
CDW_SAPP_STG_SALES SALES_F_BRANCH_NAME VARCHAR2(25)
CDW_SAPP_STG_SALES SALES_F_PRODUCT_CODE NUMBER(10)
CDW_SAPP_STG_SALES SALES_F_PRODUCT_NAME VARCHAR2(30)
CDW_SAPP_STG_SALES SALES_SOLD_QTY NUMBER(7)
CDW_SAPP_STG_SALES SALES_TOTAL_AMOUNT NUMBER(8,2)
CDW_SAPP_STG_SALES CREATED_DATE TIMESTAMP(0)
CDW_SAPP_STG_SALES CREATED_BY VARCHAR2(40)

Target Table/File name Target Field names Target DataType


CDW_SAPP_ERR CDW_P_SALES_DSET_KEY NUMBER(9)
CDW_SAPP_ERR ERROR_CODE NUMBER(9)
CDW_SAPP_ERR ERR_MSG VARCHAR2(100)
CDW_SAPP_ERR ERR_COLUMN_NM VARCHAR2(25)
Description
Surrogate key for the fact table
Surrogate key of the period(time) table
Surrogate key of the period(time) table
Surrogate key of the period(time) table
surrogate key of the customer dim table
surrogate key of the supplier dim table
Surrogate key of the branch table
Branch name in which the was product sold
Product code
Name of the product sold
Quantity of product sold
Total amount
Load date
The workflow name

Description
Identifies the record in which the error ocured
uniquely identifies the error record
Defines the Error
Column name in which the error occurred
Mapping logic
seq NUMBER
Look up from Time dim table and load the time key.
Look up from Time dim table and load the time key.
Look up from Time dim table and load the time key.
look up from customer dim table.
look up from supplier dim table
look up from Location dim table
Direct move
look up from product code
Direct move
Direct move from the file/check for decimal values
Need to be calculated from the product table data (Price of product)and sales_qty.
sysdate
workflow name

Mapping logic
Need to load the primary key of record (CDW_P_SALES_DSET_KEY) in which error o
Generate the Error code based on the error.
Decode the Error code and set a relavent message
Load the name of the column in which has error
Source File Name Source File Column Names Source Data Type
- - -
CDW_SAPP_F_SALES_BR_XX DAY NUMBER(2)
CDW_SAPP_F_SALES_BR_XX MONTH NUMBER(2)
CDW_SAPP_F_SALES_BR_XX YEAR NUMBER(4)
CDW_SAPP_F_SALES_BR_XX CUSTOMER_SSN NUMBER(9)
CDW_SAPP_F_SALES_BR_XX SUPPLIER_SSN NUMBER(9)
CDW_SAPP_F_SALES_BR_XX BRANCH_NAME STRING(25)
CDW_SAPP_F_SALES_BR_XX BRANCH_NAME STRING(25)
CDW_SAPP_F_SALES_BR_XX PRODUCT_NAME STRING(30)
CDW_SAPP_F_SALES_BR_XX PRODUCT_NAME STRING(30)
CDW_SAPP_F_SALES_BR_XX QUANTITY_SOLD NUMBER(7,2)
CDW_SAPP_F_SALES_BR_XX QUANTITY_SOLD NUMBER(7)
CDW_SAPP_F_SALES_BR_XX NA NA
CDW_SAPP_F_SALES_BR_XX NA NA

Source File Name Source File Column Names Source Data Type
- - -
- - -
- - -
CDW_SAPP_F_SALES_BR_XX - -
Target Table/File name Target Field names Target DataType
CDW_SAPP_F_SALES CDW_XYZ_F_SALES_DSET_KEY NUMBER(9)
CDW_SAPP_F_SALES SALES_F_PERIOD_KEY DATE
CDW_SAPP_F_SALES SALES_F_CUSTOMER_Key NUMBER(10)
CDW_SAPP_F_SALES SALES_F_SUPPLIER_Key NUMBER(10)
CDW_SAPP_F_SALES SALES_F_BRANCH_CODE NUMBER(9)
CDW_SAPP_F_SALES SALES_F_BRANCH_NAME VARCHAR2(25)
CDW_SAPP_F_SALES SALES_F_PRODUCT_CODE NUMBER(10)
CDW_SAPP_F_SALES SALES_F_PRODUCT_NAME VARCHAR2(30)
CDW_SAPP_F_SALES SALES_SOLD_QTY NUMBER(7)
CDW_SAPP_F_SALES SALES_TOTAL_AMOUNT NUMBER(8,2)
CDW_SAPP_F_SALES CREATED_DATE TIMESTAMP(0)
CDW_SAPP_F_SALES CREATED_BY VARCHAR2(40)

sql Override.
Description
Surrogate key for the fact table
Surrogate key of the period(time) table
surrogate key of the customer dim table
surrogate key of the supplier dim table
Surrogate key of the branch table
Name of the Branch
Product code
Name of the Product
Quantity of product sold
Total amount
Load date
The workflow name
Mapping logic
Direct Move
Direct Move (Convert to date datatype)
Direct Move
Direct Move
Direct Move
Direct Move
Direct Move
Direct Move
Direct Move
Direct Move
Direct Move
Direct Move
Source Table Name Source File Column Names Source Data Type
CDW_SAPP_STG_SALES CDW_P_SALES_DSET_KEY NUMBER(9)
CDW_SAPP_STG_SALES SALES_F_PERIOD_KEY VARCHAR2(8)
CDW_SAPP_STG_SALES SALES_F_CUSTOMER_KEY NUMBER(10)
CDW_SAPP_STG_SALES SALES_F_SUPPLIER_KEY NUMBER(10)
CDW_SAPP_STG_SALES SALES_F_BRANCH_CODE NUMBER(9)
CDW_SAPP_STG_SALES SALES_F_BRANCH_NAME VARCHAR2(25)
CDW_SAPP_STG_SALES SALES_F_PRODUCT_CODE NUMBER(10)
CDW_SAPP_STG_SALES SALES_F_PRODUCT_NAME VARCHAR2(30)
CDW_SAPP_STG_SALES SALES_SOLD_QTY NUMBER(7)
CDW_SAPP_STG_SALES SALES_TOTAL_AMOUNT NUMBER(8,2)
CDW_SAPP_STG_SALES CREATED_DATE NA
CDW_SAPP_STG_SALES CREATED_BY NA
Target Table/File name Target Table/File name

CDW_SAPP_F_AGG_DATA CDW_SAPP_F_AGG_DATA

CDW_SAPP_F_AGG_DATA CDW_SAPP_F_AGG_DATA
CDW_SAPP_F_AGG_DATA CDW_SAPP_F_AGG_DATA

CDW_SAPP_F_AGG_DATA CDW_SAPP_F_AGG_DATA
CDW_SAPP_F_AGG_DATA CDW_SAPP_F_AGG_DATA

CDW_SAPP_F_AGG_DATA CDW_SAPP_F_AGG_DATA

CDW_SAPP_F_AGG_DATA CDW_SAPP_F_AGG_DATA
CDW_SAPP_F_AGG_DATA CDW_SAPP_F_AGG_DATA

sql Override.
Convert the SALES_F_PERIOD_KEY to
date and then fetch one month data
to load the aggreagte table

ch
Source extract logic :

Source data should be extracted only for the


previous month for which analysis needs to be
done.
Target Field names Target DataType Description

CDW_SALES_AGG_DSET_KEY Number(9) Surrogate key for theAggregate table


NUMBER(9) Uniquely identifies a branch of the retail store(group
BRANCH_CODE by column)
BRANCH_NAME VARCHAR2(25) Branch Name For which the report is being taken
NUMBER(10) Uniquely identifies a product of the retail store(group
PRODUCT_CODE by column)
PRODUCT_NAME VARCHAR2(30) Name of the product from product table
NUMBER(7) Total quantity for each product sold in each branch
TOTAL QUANTITY
NUMBER(8,2) Total amount for each product sold in each branch
TOTAL AMOUNT
CREATED_DATE Date Date created
Mapping logic Source Table Name

Sequence generated number -

Branch code for the current reporting period sold in each branch CDW_SAPP_F_SALES
Branch name for the corresponding branch CDW_SAPP_F_SALES

Product code for the current reporting period sold in each branch CDW_SAPP_F_SALES
Product name for the corresponding product sold CDW_SAPP_F_SALES
Sum of the total quantity of a particular product sold in each branch for the current
reporting period. CDW_SAPP_F_SALES
Sum of the price sold of a particular product in each branch for the current reporting
period. CDW_SAPP_F_SALES
Sysdate -
Source File Column Names Source Data Type

- -
NUMBER(9)
SALES_F_BRANCH_CODE
SALES_F_BRANCH_NAME VARCHAR2(25)
NUMBER(10)
SALES_F_PRODUCT_CODE
SALES_F_PRODUCT_NAME VARCHAR2(30)
NUMBER(7)
SALES_SOLD_QTY
NUMBER(8,2)
SALES_TOTAL_AMOUNT
- -
Target File name Target Field names Target DataType

NUMBER(9)
MNTH_SALES_RPT_BRANCH_FILE BRANCH_CODE
MNTH_SALES_RPT_BRANCH_FILE BRANCH_NAME STRING(25)
MNTH_SALES_RPT_BRANCH_FILE TOTAL_REVENUE NUMBER(8,2)
MNTH_SALES_RPT_BRANCH_FILE CREATED_DATE Date

MNTH_SALES_RPT_PRODUCT_FILE PRODUCT_CODE NUMBER(10)


MNTH_SALES_RPT_PRODUCT_FILE PRODUCT_NAME STRING(30)
MNTH_SALES_RPT_PRODUCT_FILE TOTAL QUANTITY NUMBER(7)
NUMBER(8,2)
MNTH_SALES_RPT_PRODUCT_FILE TOTAL_REVENUE
MNTH_SALES_RPT_PRODUCT_FILE CREATED_DATE Date

Load the two files from same mapping.


Description

Uniquely identifies a branch of the retail store(group


by column)
Branch Name For which the report is being taken
Total Revenue generated in a branch.
Date created

Uniquely identifies a product.(group by column)


Name of the product.
Total Revenue generated in a branch.
Total Revenue generated by each product.

Date created
Mapping logic Source Table Name

Load the branch code which shown highest revenue. CDW_SAPP_F_AGG_DATA


Load the branch name which shown highest revenue. CDW_SAPP_F_AGG_DATA
Cumulative sum of revenues for all products sold in the branch. CDW_SAPP_F_AGG_DATA
Sysdate -

Load the top five product code which as shown highest revenue. CDW_SAPP_F_AGG_DATA
Load the product name which shown highest revenue. CDW_SAPP_F_AGG_DATA
Cumulative sum of products sold during reporting period. CDW_SAPP_F_AGG_DATA
Cumulative sum of revenues for all products sold during reporting
period. CDW_SAPP_F_AGG_DATA
Sysdate -
Source Table Column Names Source Data
Type
NUMBER(9)
SALES_F_BRANCH_CODE
SALES_F_BRANCH_NAME VARCHAR2(25)
SALES_TOTAL_AMOUNT NUMBER(8,2)
- -

PRODUCT_CODE NUMBER(10)
PRODUCT_NAME VARCHAR2(30)
TOTAL QUANTITY NUMBER(7)
NUMBER(8,2)
TOTAL AMOUNT
- -

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