Date Dimension Creation
+2
ngalemmo
DavidStein
6 posters
Page 1 of 1
Date Dimension Creation
I've read several of the Kimball Group Books and each time I read about a Date Dimension it is recommended that it be built in a Spreadsheet. Is this still the accepted method?
I'm generating mine in SQL Script and I wondered if most were still using spreadsheets and exporting the data to their database product of choice.
I searched for references to it in the forum but came up empty.
I'm generating mine in SQL Script and I wondered if most were still using spreadsheets and exporting the data to their database product of choice.
I searched for references to it in the forum but came up empty.
DavidStein- Posts : 24
Join date : 2010-04-01
Re: Date Dimension Creation
Here's the thing... a date dimension is the type of thing you create once. And maybe you need to add some rows every 5 or 10 years. Do it the simplest way you can. If you happen to be adept at Excel, it's really easy to throw something together. If you prefer some other means (stored procedure, perhaps) fine. Choose a method that makes sense... there is no point in overengineering something like this.
Re: Date Dimension Creation
The SQL logic to determine holidays, etc, can be challenging. I would hate to have to code it from scratch. How you do it matters little.
BoxesAndLines- Posts : 1212
Join date : 2009-02-03
Location : USA
Re: Date Dimension Creation
I agree that it is complex. However, I took the code from this stored procedure and heavily modified it to include our special fiscal periods and "work weeks". We are on a 4-4-5 period structure.
It includes all of his regular calendar attributes, which are exceptionally robust, and adds new fiscal fields which are derived from the OLTP source.
On my test server, the whole process requires less than 30 seconds to complete.
It includes all of his regular calendar attributes, which are exceptionally robust, and adds new fiscal fields which are derived from the OLTP source.
On my test server, the whole process requires less than 30 seconds to complete.
DavidStein- Posts : 24
Join date : 2010-04-01
Re: Date Dimension Creation
That would make the decision easy for me. :^)
BoxesAndLines- Posts : 1212
Join date : 2009-02-03
Location : USA
Re: Date Dimension Creation
I built the base table in Excel and then loaded it into Access that attaches to a REFERENCE database that keeps all of my reference information in SQL. I use Access to keep it updated.
I recommend keeping the components of your date dimension in 3nf. The Date Dimension can contain so many different elements - Names of Months, abbreviation of Month, Names of Days, Abbreviation of Days, Year and Month as Jan 2010 or as 201001. It can contain the quarter, holidays, a Week Day Indicator, Business Day, promotional period, Bad Weather Days (for when a facility is closed because of snow).... Just a myriad of information. My date dimension has the date in different forms to match the various source systems.
I recommend keeping the components of your date dimension in 3nf. The Date Dimension can contain so many different elements - Names of Months, abbreviation of Month, Names of Days, Abbreviation of Days, Year and Month as Jan 2010 or as 201001. It can contain the quarter, holidays, a Week Day Indicator, Business Day, promotional period, Bad Weather Days (for when a facility is closed because of snow).... Just a myriad of information. My date dimension has the date in different forms to match the various source systems.
Jeff Smith- Posts : 471
Join date : 2009-02-03
Re: Date Dimension Creation
it is complex,though reading books helps a lot.
reenfoo- Posts : 1
Join date : 2010-09-08
Re: Date Dimension Creation
I wrote a simple VB .NET utility to generate mine. I was able to build the logic to generate attributes for a 13-period fiscal calendar (including handling the occasional 53-week year) into the program. It spits out a text file of SQL INSERT statements which I execute to populate the date dimension.
VHF- Posts : 236
Join date : 2009-04-28
Location : Wisconsin, US
Similar topics
» Question about using date dimension keys in other dimension tables
» Date Dimension: Representing partial dates/Imputing date values
» Eliminate Date Dimension Surrogate Key
» Always link date fields to Date Dimension?
» Using the Date Dimension for Summary Fact Tables or new specialized Month Dimension?
» Date Dimension: Representing partial dates/Imputing date values
» Eliminate Date Dimension Surrogate Key
» Always link date fields to Date Dimension?
» Using the Date Dimension for Summary Fact Tables or new specialized Month Dimension?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum