Data warehouse ETL case studies (a)

Case study from the course  

A multinational food supermarket information management system will record sales of supermarket chains around the thousands of day. Based on the background of big data, the company's management decided to build a data warehouse FoodMart expected from a large data mining information of commercial value, to further help management decision-making.

Design a sales data warehouse. Claim:

1, at least four dimensions, each dimension of at least three properties, dimensional layer comprising possible.

2, at least one fact table.

3, can obtain the data source (metric field dimensions and design should be directly or indirectly in the data source).

 

* The following use SQL Server Integration Services (SSIS) 

 

(A) design of data warehouse concept model, designed as follows:

 

* According to their own design concept model of ideas that can be a snowflake can be a star

 

 

(B) the source data warehouse, data view, the loading dimension table

1. The establishment of a project

 

 

 

 

2. The data set introduced sql server (herein, the first access to the database SQL Server, SSIS reused, the drive may be used directly in the Access Lane SSIS)

 

 

 

 

 

 

  

3. establish a connection with the sql server

 

4. sequentially loading data product dimension, the customer dimension, date, dimensions, dimension chain stores, promotional dimension.

Products involved in two-dimensional tables product, product_class, according to generate a query to get the data you want

 

Destination Editor to select the new table into the data warehouse.

 

Similarly dimensional loading goods

Similarly load promotional dimension

 

Loaded customer dimension

Similarly load time dimension

It should be time string split, use a derived columns and date functions, namely the establishment of year, month, day (ps: There is no need to manually create the time dimension, data warehouse provides a template to establish the time dimension, there will be mentioned later)

5. Load fact table

这里需要对汇率进行转换,将saledetail表和currency分别处理(查找、派生、排序等)后通过合并转换的内连接,使得汇率与交易的地区相对应,再加派生列,计算所得的利润。具体的细节如下:

1)   需要将currency的地区和日期与saledetail地区与日期做处理,才能够相对应

2)两边的数据进行内连接

 

3)通过派生列计算利润

 

4)装载数据成功,共计251395行

 

 

6.结果如下:

 

在SQL数据库里可以查看装载好的数据仓库

7.在Sql数据库中设置每周六晚24时自动执行装载新业务数据

要把所有者改为[sa],才可以运行成功

 

 欢迎小伙伴的批评指正~

 

Guess you like

Origin www.cnblogs.com/EVA-YANG/p/11874447.html