Kimball Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Date Dimension Script

4 posters

Go down

Date Dimension Script Empty Date Dimension Script

Post  scabral 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

Back to top Go down

Date Dimension Script Empty Re: Date Dimension Script

Post  BoxesAndLines Fri Aug 03, 2012 9:12 am

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

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

Back to top Go down

Date Dimension Script Empty Re: Date Dimension Script

Post  scabral 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

Back to top Go down

Date Dimension Script Empty Re: Date Dimension Script

Post  LAndrews 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

Back to top Go down

Date Dimension Script Empty Re: Date Dimension Script

Post  scabral 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

Back to top Go down

Date Dimension Script Empty Re: Date Dimension Script

Post  ngalemmo 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.
ngalemmo
ngalemmo

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

http://aginity.com

Back to top Go down

Date Dimension Script Empty Re: Date Dimension Script

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

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