Solved

ROLAP date dimension link to OLTP datetime fields in tables

Posted on 2013-06-03
4
747 Views
Last Modified: 2016-02-18
Hi Experts,

Setup:

SQL Server 2008 R2
DBE
SSIS
SSAS

I have created a simple ROLAP database with four tables:

1.DimCustomer
2.DimProducts
3.DimDate
4.FactTable

My DimDate dimension is already populated with date range and the rest of the tables are empty.

Now I want to transfer data from my OLTP database into my ROLAP database. My Date granularity is at the day level.


Now what I am absolutely stumped with is how do I load data from my OLTP database into my ROLAP database with regards to date?

So for example in my OLTP database if I want to load from 2005 -2007. How do I load this data into ROLAP database, so that the ROLAP database knows I'm loading data from 2005-2007 from the OLTP database. So if i run a query in the ROLAP for date range 2005-2007 I will get the same results as OLTP.


I have looked at AdventureWorksDW2008 and I cant figure out how data was loaded from OLTP into ROLAP whilst keeping the date in sync.


Ultimately what I am asking if I am loading data from any source into ROLAP, what actions do I take to match the data dates?

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
 

Author Comment

by:J3D1-KN1G1-1t
ID: 39216530
Dont worry I got it, the Fact table has the related OLTP dates....


I will still award though for best answer.
0
 
LVL 37

Accepted Solution

by:
ValentinoV earned 500 total points
ID: 39218286
"I will still award though for best answer."

Understood :)

"Ultimately what I am asking if I am loading data from any source into ROLAP, what actions do I take to match the data dates?"

I would say it depends on the source and on the design of the DimDate.  My ETLs usually use a staging database so the data transition would happen in two phases:

1. load from source into staging - data types are preserved as much as possible
2. load from staging into ROLAP - data types are converted to match ROLAP

It's in the second phase that the fact records need to get matched with the correct dimension records. Usually I use the SSIS Lookup component for that.

Now, DimDate is a special case. In most cases it is a bad idea to put any logic in a primary key but in the case of DimDate it's actually very practical.  Just as they did in AdventureWorksDW, the DateKey is an int with a special structure: YYYYMMDD.

The fact that DimDate is a pre-populated dimension means we know exactly what's in there and what the foreign key in the fact table needs to look like.  Which means we don't need to waste time on a lookup here.

In case your incoming date field is of type datetime (or date), you could fabricate the key using the SSIS Derived Column transform and some math through an expression like:

YEAR(YourDate) * 10000 + MONTH(YourDate) * 100 + DAY(YourDate)
0
 

Author Closing Comment

by:J3D1-KN1G1-1t
ID: 39221594
Thank YOu
0
 
LVL 37

Expert Comment

by:ValentinoV
ID: 39221706
So no further questions on that? Cool! Thank you for accepting my answer! :)
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differeā€¦
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

631 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