Sie sind auf Seite 1von 3

1 Overview

This document is a template for creating ETL Mapping documents. This document describes the
mapping requirements for populating a new Employee table using data from a fictitious database.
A report is required that provides information on each employee's actual hourly rate versus the
agreed hourly rate. Actual hours will be calculated using the employee's salary and the number of
actual hours worked by each employee for a given year.

2 Source Definition
Current employees of a given type are to be processed. If the employee type is not supplied, all
employees are processed.
The EMP table is used as the main driving table. Records matching the following criteria are
extracted:
END_DATE is NULL
EMP_TYPE_ID = <specified or All>

2.1 Column Definition


Table Name Column Name Data Type Description
param year CHAR(4) The year of interest
param emp_type CHAR(30) The type of employee (i.e. permanent,
temporary, casual, etc.)
PERIOD WORK_DAY NUMBER(9) Boolean flag indicating if a date is a
work day
PERIOD CAL_DATE DATE Date
EMP NAME CHAR(30) Employee's full name (Last Name,
First Name, Middle Name)
EMP START_DATE DATE Employee's start date
EMP_TYPE TYPE CHAR(30) Employee Type Name
EMP_TYPE HOURS_PER_D NUMBER(6,2) Number of work hours per day
AY
LEAVE_TYPE TYPE CHAR(30) Leave Type Name
LEAVE DAYS NUMBER(5) Number of days leave
POS POSITION CHAR(30) Position Name
POS SALARY NUMBER(9,2) Employee's annual base salary

N.B. param – indicates values that are passed into the job
2.2 TABLE RELATIONS
Table Card* Join Card* Table
EMP 1 EMP_ID=EMP_ID 1..n POS
EMP 1 EMP_ID=EMP_ID 0..n LEAVE
LEAVE_ID=TYPE_ID
EMP 0..n EMP_TYPE_ID=TYPE_ID 1 EMP_TYPE
LEAVE 0..n LEAVE_ID=TYPE_ID 1 LEAVE_TYPE
* Card = Cardinality

3 Target Definition
Schema: REPORTS
Table Name: Employees
Column Name Data Type Mapping Rule Description
LAST_NAME CHAR(30) R1 Employee's Last Name
FIRST_NAME CHAR(30) R1 Employee's First Name
MIDDLE_NAME CHAR(30) R1 Employee's Middle Name
START_DATE CHAR(30) R2 (EMP.START_DATE) Employee's start date
END_DATE CHAR(30) R2 (EMP.END_DATE) Employee's end date – null
if current
POSITION CHAR(30) POS.POSITION Position Name
LEAVE_HOURS NUMBER(9 R3 Number of hours leave
,2)
EFFECTIVE_HOURLY_R NUMBER(9 R4 Employee's hourly rate
ATE ,2)

4 Mapping Rules

4.1 R1 – Name Split


Split EMP.NAME on spaces. This should produce 3 values
First value = Last Name
Second value = First Name
Third value = Middle Name
If EMP.NAME is NULL or empty then reject and report
If there are only two values then set Middle Name to “”
If there is only one value then reject and report
Trim all values and convert to uppercase
4.2 R2 – Date Conversion
Date fields are converted to character fields with format YYYY-MM-DD
The time portion is discarded

4.3 R3 – Day To Hour Conversion


Get the total number of days leave (DL) from the LEAVE table
Hours Leave (HL) = DL / HOURS_PER_DAY
Values are rounded down to 2 decimal places

4.4 R4 – Hourly Rate


Get the total number of work days (WD) for the given year (param.year)
Work Hours (WH) = WD / HOURS_PER_DAY
Actual Work Hours (AH) = WH - LEAVE_HOURS
Hourly Rate (HR) = POS.SALARY / AH
Values are rounded up to 2 decimal places

Das könnte Ihnen auch gefallen