0% found this document useful (0 votes)
51 views

Lec4 DM

The document discusses building a data warehouse to store sales data from multiple branches of a company in a centralized repository. It describes extracting sales information from each branch's database, transforming and cleaning the data, and loading it into dimensional fact and dimension tables in the data warehouse. This allows generating consolidated sales reports across branches by product, time period, and region using the data warehouse.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

Lec4 DM

The document discusses building a data warehouse to store sales data from multiple branches of a company in a centralized repository. It describes extracting sales information from each branch's database, transforming and cleaning the data, and loading it into dimensional fact and dimension tables in the data warehouse. This allows generating consolidated sales reports across branches by product, time period, and region using the data warehouse.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 29

Data Warehousing

Scenario
ABC is a company with four branches at x1,
x2, x3 and x4. The Sales Manager wants quarterly sales report. Each branch has a separate operational system.

Scenario 1 : ABC
x1

x2

Sales per item type per branch for first quarter.


x3

Sales Manager

x4

Solution1 :ABC

Extract sales information from each database. Store the information in a common repository at a single site.

Solution1 :ABC
x1

Report x2 Data Warehouse x3 Query & Analysis tools Sales Manager

x4

Solution 2
Data Entry Operator Report

Transaction

Operational database

Extract data

Data Warehouse

Manager

Data Entry Operator

DWH Architecture (Basic)

DWH Architecture (with a staging area)

DWH Architecture (with a staging area and data marts))

Building Data Warehouse


1- Creating Data Preparation Area 2-Creating Data Warehouse 3- Data Extraction & Cleansing & Transformation 4- Loading Data in Data Warehouse 5- Creating DSS Applications & OLAP

Building Data Warehouse

Data Selection Data Preprocessing


Fill missing values Remove inconsistency

Data Transformation & Integration Data Loading


Data in warehouse is stored in form of fact tables and dimension tables.

Example
1. Data selection
Cust-_id
101104 101105 101102

Cust_name
Ali moh Yasir musa
Mhd ali ahmed

Adress
bahri alsahafa

date
1-4-2009 1-1-1 28-2-2008

News paper goansport


sadaalahdas alintibaha goansport alintibaha altayar

soba
karari
ombada soba

101115
101034 101244

Ali mhd adam Eltayeb hassan


Mhd ali ahmd

1-1-1
2-2-2009 20-4-2009

2- Data Cleaning
De-duplication Lack of Domain Consistency


Cust_id
101104 101105 101102

Add more data


Cust_name blance
Ali moh Yasir musa
Mhd ali ahmed

B_date
1-4-1978

salary

Owns acar

Have ahouse

100000

30000
5300

2-3-1980
7-8-1987

3000 1000 500

no yes no

yes yes no

Add data to DB

Cust -_id

Cust_ name

Adres s
bahri

date

balanc e
100000

B_dat e
1-4-1978

salary

Owns acar
no

Have News paper ahouse


yes

101104 Ali moh

1-4-2009

3000

goansport

101105
101102 101115 101034 101244

Yasir 30000 alsahafa 1-1-1 musa Mhd ali 5300 soba 28-2-2008 ahmed Ali mhd karari null 1-1-1 adam Eltayeb ombada 2-2-2009 null hassan Mhd ali soba 20-4-2009 5300 ahmd

2-3-1980
7-8-1987 null null 7-8-1987

1000
500 null null 500

yes
no null null no

yes
no null null no

sadaalahdas
alintibaha goansport

alintibaha
altayar

Cust -_id

Cust_ name

Adres s
bahri

date

balanc e
100000

B_dat e
1-4-1978

salary

Owns acar
no

Have News paper ahouse


yes

101104 Ali moh

1-4-2009

3000

goansport

Yasir musa Mhd ali 101102 ahmed Mhd ali 101244 ahmd 101105

alsahafa
soba soba

1-1-1
28-2-2008 20-4-2009

30000
5300 5300

2-3-1980
7-8-1987 7-8-1987

1000
500 500

yes
no no

yes
no no

sadaalahdas
alintibaha altayar

Cust_id
101104 101105 101102 101244

Adress balance B_date

salary

Owns acar
0 1 0 0

Have News paper ahouse


1 1 0 0

bahri alsahafa soba soba

100

34 32 25 25

3 1 ,5 ,5

goansport

30
5,3 5,3

sadaalahdas
alintibaha altayar

Flattening

Cus Adr tess _id


10110 bahri 4 10110 alsahaf a 5 10110 soba 2 10124 soba 4

bala nce

B_da salar Own Have altay alinti sada goansport te y s ahou ar baha alah acar se das
34
32 25

100 30 5,3

3
1 ,5

0
1 0

1
1 0

0
1 0

0
0 1

0
0 0

1 0 0 0

5,3

25

,5

Case Study

Afco Foods & Beverages is a new company which produces dairy,bread and meat products with production unit located at soba There products are sold in khartoum ,khartoum bahri and omdurman They have sales units at khartoum north, khartoum west , omdurman ,bahri and soba. The President of the company wants sales information.

Sales Information
Report: The number of units sold.
113

Report: The number of units sold over time

January

February

March

April

14

41

33

25

Sales Information
Report : The number of items sold for each product with time
Jan Feb Mar Apr Wheat Bread Cheese Burger 6 8 16 25 6 6 21
Product

17 8

Sales Information
Report: The number of items sold in each City for each product with time
Jan khartou m Wheat Bread Feb Mar 3 Apr 10

Cheese
Burger bahri Wheat Bread Cheese Burger

3
4

16
16

6
6 3 7 8
Product Time

3 4 9 15

Sales Information
Report: The number of items sold and income in each region for each product with time.
Jan $ U Feb $ U Mar $ U Apr $ U

KH

Wheat Bread
Cheese Burger 7.95 7.32 3 4 42.40 29.98 16 16

7.44
15.90 10.98

3
6 6

24.80

10

BAHRI

Wheat Bread
Cheese Burger 7.95 7.32 3 4 16.47 9

7.44

17.36
21.20

7
8

27.45

15

Sales Measures & Dimensions


Measure Units sold, Amount. Dimensions Product,Time,Region.

Sales Data Warehouse Model


Fact Table
City khartoum khartoum Product Cheese Cheese Swiss Rolls Month January January February Units 3 4 7.95 7.32 $

Wheat Bread January

bahri
bahri khartoum

Wheat Bread January

3
4 16

7.95
7.32 42.40

Sales Data Warehouse Model


City_ID Prod_ID 1 1 589 1218 Month 1/1/1998 1/1/1998 Units 3 4 $ 7.95 7.32

2
2 1

589
1218 589

1/1/1998
1/1/1998 2/1/1998

3
4 16

7.95
7.32 42.40

Sales Data Warehouse Model


Product Dimension Tables
Prod_ID 589 590 288 Product_Name Wheat Bread White Bread Coconut Cookies Product_Category_ID 1 1 2

Product_Category_Id Product_Category 1 2 Bread Cookies

Sales Data Warehouse Model


Region Dimension Table
City_ID 1 City khartoum Region Khartoum Country Sudan

bahri

Khartoum bahri

sudan

Sales Data Warehouse Model


Time

Sales Fact

Product

Product Category

Region

OLAP Cube
City All Mumbai Mumbai Mumbai Mumbai Mumbai Product All All White Bread Time All All All Units 113 64 38 13 3 3 Dollars 251.26 146.07 98.49 32.24 7.44 7.44

Wheat Bread All Wheat Bread Qtr1 Wheat Bread March

You might also like