Date Dimension Script

View previous topic View next topic Go down

Date Dimension Script

Post  scabral on Thu Aug 02, 2012 4:03 pm

Hi,

Does anyone have a good script to create a Date Dimension based on Kimball best practices?

thanks

scabral

Posts : 58
Join date : 2012-05-02

View user profile

Back to top Go down

Re: Date Dimension Script

Post  BoxesAndLines on Fri Aug 03, 2012 9:12 am

Google date dimension. You will find many that are suitable.
avatar
BoxesAndLines

Posts : 1212
Join date : 2009-02-03
Location : USA

View user profile

Back to top Go down

Re: Date Dimension Script

Post  scabral on Fri Aug 03, 2012 2:00 pm

i have gone through the google search and found many examples, but wondering if someone feels that one is better than the other and why.

scabral

Posts : 58
Join date : 2012-05-02

View user profile

Back to top Go down

Re: Date Dimension Script

Post  LAndrews on Fri Aug 03, 2012 2:31 pm


Its a date dimension - what type of "best practices" are you looking for?

Typically its a type-1 dimension. 1 record for every date value. You can decide how many years it needs to contain based on your situation.

Atributes typically include year,month,day, both numeric and text, abbreviations, etc.


LAndrews

Posts : 132
Join date : 2010-05-13
Location : British Columbia, Canada

View user profile

Back to top Go down

Re: Date Dimension Script

Post  scabral on Fri Aug 03, 2012 2:40 pm

how about having a surrogate key or using another field like the date in MMDDYYYY format as the key? I've seen both ways being used.

scabral

Posts : 58
Join date : 2012-05-02

View user profile

Back to top Go down

Re: Date Dimension Script

Post  ngalemmo on Fri Aug 03, 2012 4:09 pm

scabral wrote:how about having a surrogate key or using another field like the date in MMDDYYYY format as the key? I've seen both ways being used.

Use of YYYYMMDD (not MMDDYYYY) is to aid DBAs when defining date based partitions for fact tables. It allows them to know the values in advance. Otherwise any surrogate value is fine.
avatar
ngalemmo

Posts : 3000
Join date : 2009-05-15
Location : Los Angeles

View user profile http://aginity.com

Back to top Go down

Re: Date Dimension Script

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum