Solved

How to load OLTP data into Dimension and Fact table

Posted on 2013-06-07
4
1,091 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 500 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

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.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

696 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