Master the Date Dimension Like a Time Lord

8,427 views

Published on

All data warehouses need a Date dimension to enable analysis by date. Most DW designers will just use a default one provided by the tools, but what if you need to set up custom holidays or want different calendars, such as Fiscal or Julian? You can have any Date dimension you want by using a single SQL script that can be modified and rerun as necessary to update the dimension. By the end of this session, you’ll be a Time Lord in your own company!

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
8,427
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Master the Date Dimension Like a Time Lord

  1. 1. Master the Date Dimension Like a Time Lord Steve Wake Sr. Business Intelligence Consultant President, Denver SQL Server User Group MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
  2. 2. What is a Date Dimension? • Dimension to track dates (usually by day) • Can track multiple calendars (Julian, fiscal) • Time should be in separate Dimension (if needed) • One row per date/day
  3. 3. What is a Time Dimension? • Dimension to track time hours/minutes/seconds (depends on application) • Keep time zones in mind • Separate from Date Dimension for flexibility • Only needs to cover 24 hours
  4. 4. Why Date/Time Dimensions? • Most reporting is done by date/time • Track Holidays and other significant dates • Do date calculations in SQL once • Date/Time period comparisons • Generate for years/decades easily
  5. 5. Date/Time Dimension Types • Calculated • Tool Created • Custom Physical • Hybrid
  6. 6. What to Include in the Date_DIM? • Date as Integer for PK to make reload not break links (20130806) • Date in multiple formats (“08/06/2013”, “Tuesday, August 6, 2013”, etc.) • Multiple parts (Month, Day, Year, Month Text, Day Text, etc.) • Holiday indicator (domestic/international/religious) • Julian/Fiscal Calendars • Calculated measures (Day # in week, Day # in month, Day # in year, Week # in month, Week # in year, etc.)
  7. 7. Demo • Date_DIM script
  8. 8. Summary • What & Why of Date/Time Dimensions • Date Dimension Benefits • What to Include in Date Dimension • Doctor Who’s 50th Anniversary!
  9. 9. See you soon… My Email: swake@pragmaticworks.com My Blog: http://blog.wakebi.com My Twitter: @stevewake Products Services BI products to convert to a Microsoft BI platform and simplify development on the platform. Speed development through training, and rapid development services from Pragmatic Works. Foundation Helping those who do not have the means to get into information technology and to achieve their dreams.

×