473,387 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Time Dimension Design Question

Im trying to design my time dimension and need to add a field to
handle null dates in the fact. So if at the time of ETL the date isnt
known, referential integrity will be preserved. Kimball suggests
insterting a record in the time dimension to handle this with a
description of 'Date not available' or something like that. However
if users are doing inner joins on the dimension they will obvisously
be pulling the datetime field..what should be in the datetime field
for this particular record?
Dec 19 '07 #1
4 3115
On Dec 19, 12:08 pm, Jimbo <jamesfer...@hotmail.comwrote:
Im trying to design my time dimension and need to add a field to
handle null dates in the fact. So if at the time of ETL the date isnt
known, referential integrity will be preserved. Kimball suggests
insterting a record in the time dimension to handle this with a
description of 'Date not available' or something like that. However
if users are doing inner joins on the dimension they will obvisously
be pulling the datetime field..what should be in the datetime field
for this particular record?
James,

If I'm reading right (DW Toolkit 2d Ed, pp 60, 261), I don't think
Kimball is suggesting that you put a dummy date in the dimensional row
(e.g. 1/1/1900 or 12/21/9999)--although I suppose you could do that if
that's a convention your users would agree to--but rather that that
value be NULL, just as it is in the source data. (This would mean,
though, that your date column in the dimensional table would have to
be NULLable.)

I suppose that when you then join the fact to the time dimension, you
could apply a COALESCE to the date column, e.g.,
COALESCE(time_dim.date, 'Date not Available').

--Jeff
Dec 20 '07 #2
On Dec 19, 10:42 pm, jefftyzzer <jefftyz...@sbcglobal.netwrote:
On Dec 19, 12:08 pm, Jimbo <jamesfer...@hotmail.comwrote:
Im trying to design my time dimension and need to add a field to
handle null dates in the fact. So if at the time of ETL the date isnt
known, referential integrity will be preserved. Kimball suggests
insterting a record in the time dimension to handle this with a
description of 'Date not available' or something like that. However
if users are doing inner joins on the dimension they will obvisously
be pulling the datetime field..what should be in the datetime field
for this particular record?

James,

If I'm reading right (DW Toolkit 2d Ed, pp 60, 261), I don't think
Kimball is suggesting that you put a dummy date in the dimensional row
(e.g. 1/1/1900 or 12/21/9999)--although I suppose you could do that if
that's a convention your users would agree to--but rather that that
value be NULL, just as it is in the source data. (This would mean,
though, that your date column in the dimensional table would have to
be NULLable.)

I suppose that when you then join the fact to the time dimension, you
could apply a COALESCE to the date column, e.g.,
COALESCE(time_dim.date, 'Date not Available').

--Jeff
Ah that makes sense...thanks, thats what I'll do.

-Jim
Dec 20 '07 #3
jefftyzzer wrote:
I suppose that when you then join the fact to the time dimension, you
could apply a COALESCE to the date column, e.g.,
COALESCE(time_dim.date, 'Date not Available').
Don't you have to CAST or CONVERT time_dim.date to CHAR or VARCHAR
first, lest it try and fail to convert 'Date not Available' to
DATETIME instead?
Dec 24 '07 #4
On Dec 24 2007, 2:33 pm, Ed Murphy <emurph...@socal.rr.comwrote:
jefftyzzer wrote:
I suppose that when you then join the fact to thetimedimension, you
could apply a COALESCE to the date column, e.g.,
COALESCE(time_dim.date, 'Date not Available').

Don't you have to CAST or CONVERT time_dim.date to CHAR or VARCHAR
first, lest it try and fail to convert 'Date not Available' to
DATETIME instead?
Please consider a web page I maintain dedicated to providing the
building blocks for kick starting a date dimension: http://www.ipcdesigns.com/dim_date/
All of the information is free including free downloads of scripts to
build a date dimension from scratch or download one that is pre-built.
If you find the downloads helpful, please leave a comment. You don't
even have to register, but I do appreciate feedback. There are also
other free tool kits for data profiling and one for ETL metadata
management should be ready by February 1, 2008. Best of luck, Don
McMunn
Jan 15 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Steve Jorgensen | last post by:
Hi all, I'm working on the schema for a database that must represent data about stock & bond funds over time. My connundrum is that, for any of several dimension fields, including the fund name...
6
by: Ben Ingram | last post by:
Hi all, I am writing a template matrix class in which the template parameters are the number of rows and number of columns. There are a number of reasons why this is an appropriate tradeoff for...
6
by: Adam Hartshorne | last post by:
The input to a function of a 3rd party library I want to use requires a double**, which is a multi-dimension array of doubles. I have looked on the net etc and seen several ways of supposedly...
3
by: Ruben Campos | last post by:
Greetings. Some time ago, I had writing a CVector <T, N> class, which implements an algebraic vector of arbitrary both dimension and scalar type. First, I defined the interface for the generic...
0
by: thefirstwml | last post by:
I am planning to load large XML files into relational tables using the dxxShredXML stored procedure. There is a major limitation on the size of the files, and I read on this group that this can be...
29
by: Roy Gourgi | last post by:
Hi, I am new to C#. I have the same time scheduling program written in C++ and it is 5 times faster than my version in C#. Why is it so slow as I thought that C# was only a little slower than...
2
by: Nathan Sokalski | last post by:
I have a multidimensional array declared as the following: Dim guesses(14, 5) As Integer I want to assign all values in a specific dimension to another array declared as follows:
5
by: Jackson | last post by:
I have something that is stumping me. I am trying to initialize a 3 dimensional string array with the code below, but it wont compile. Can anyone explain what Im doing wrong?????????????? Im...
11
by: greg | last post by:
Hi all, Is there a way to get the current theme name at design time? I'm trying to write a custom control for which I need to use images from the current theme. I have asigned a theme to the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.