?
Solved

How to load OLTP data into Dimension and Fact table

Posted on 2013-06-07
4
Medium Priority
?
1,126 Views
Last Modified: 2013-07-06
Experts,


I have a Dim Customer table and Dim Products table and a FactSaletable:

Dim Customer Table:

CustomerID     AlternateKey     CustomerName       CustomerCompany
1                      34525                James Boags            Target

Dim Products table:

ProductID       AlternateKey     ProductType        ProductName
1                     345354              Large                   Ball


FactSales table:

ID     CustomerID(FK)    ProductID(FK)      Qty     SalesAmount
1        1                          1                           2       $45


So I have created primary keys for all dimension tables which are foreign keys in the Fact table. Also a primary key for the fact table.

Now how am I suppose to load data into these tables from the OLTP database so items and
customer details are referenced accurately. I dont know how to relate the OLTP data to the fact tables so it references the Dim tables.

Please let me know if you need further details. Any help would be greatly appreciated.


Many Thanks,

J3di
0
Comment
Question by:J3D1-KN1G1-1t
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 23

Expert Comment

by:Racim BOUDJAKDJI
ID: 39228819
I dont know how to relate the OLTP data to the fact tables so it references the Dim tables.
You first fill your dimension tables then your fact table using INSERT statement based on selections from your OLTP.   Please make sure you use SELECT DISTINCT to avoid redundant rows.

Hope this helps.
0
 
LVL 23

Accepted Solution

by:
Racim BOUDJAKDJI earned 1000 total points
ID: 39228822
Additionally, relating the table functionally to the new structure requires business knowledge so my guess is that it would be a good idea to involve the OLTP designers to establish that knowledge.
0
 

Author Comment

by:J3D1-KN1G1-1t
ID: 39231028
Thanks Racimo for your responses. I am aware of OLTP design and business processes.

What I really want to know is how does the dimension table know which row to look at in the fact table.

For example the DimCustomer table has a primary key(CustomerID=1) which is the foreign key in the Fact table. The Alternate key is the actual (CustomerID=34525) in the OLTP database.

So lets say I'm loading the DimCustomer table with :

CustomerID     AlternateKey     CustomerName       CustomerCompany
1                      34525                James Boags            Target


How do I relate and load this information into the fact table. I would understand if the primary for the DimCustomer 34525(alternate) and then this is the foreign key in the fact table. So all inserted data from OLTP is matching in relationship of the ROLAP database.

I get lost in ROLAP concept when there is new customerID in the DIM table and the OLTP key becomes the alternate key.

So I guess If you could please explain the concept or give an example I could better understand.

Many Thanks
0
 

Author Comment

by:J3D1-KN1G1-1t
ID: 39231231
After researching I came up with this. Please let me know if it correct.

If I'm loading measures from the OLTP source into Factable. I would have to

1. Lookup the primary key of DimTable by referencing the alternate key with the ID from source DB

2. Add the DimTable Primary KeyID in the fact table and then add then add the measure in.

3. Which means I would have a view or table setup in the the OLTP(with multiple joins) showing Dim and Measure information in a single row. (this would be my source)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question