Date Dimension in 30 
Minutes or Less 
Steve Wake 
Consultant, RevGen Partners 
President, Denver SQL Server User Group
What is a Date Dimension? 
• Dimension to track dates (usually by day) 
• Can track multiple calendars (Gregorian, 
Julian...
Why Date Dimension? 
• Most reporting is done by date/time 
• Track Holidays and other significant dates 
• Do date calcul...
What to Include in the Date_DIM? 
• Date as Integer for PK to make reload not break 
links (20130806) 
• Date in multiple ...
Demo 
• Date_DIM script
Summary 
• What & Why of Date Dimensions 
• Date Dimension Benefits 
• What to Include in Date Dimension
September 20, 2014 on the University of Denver campus! 
Multiple tracks of sessions 
Speakers from across the country 
Gre...
Contact 
• swake@revgen.com 
• @stevewake on Twitter 
• LinkedIn, Google+ 
• Blog – http://wakebi.com
Upcoming SlideShare
Loading in …5
×

Date Dimension in 30 Minutes or Less

129
-1

Published on

All data warehouses need a date dimension to enable proper analysis across dates. Most Data Warehouse designers will just use one provided by tools or whip it up in Excel, 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 need by using a single SQL script that can be modified and rerun as necessary. Learn what it takes to design a date dimension that does all of the calculations and formatting up-front so the reports can be easier to create. Sample script will be provided that creates the date dimension and can be reused as often as necessary without breaking your data warehouse and it only takes seconds to run!

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

  • Be the first to like this

No Downloads
Views
Total Views
129
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Date Dimension in 30 Minutes or Less

  1. 1. Date Dimension in 30 Minutes or Less Steve Wake Consultant, RevGen Partners President, Denver SQL Server User Group
  2. 2. What is a Date Dimension? • Dimension to track dates (usually by day) • Can track multiple calendars (Gregorian, Julian, Fiscal) • Time should be in separate Dimension (if needed) • One row per date/day
  3. 3. Why Date Dimension? • 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
  4. 4. 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) • Gregorian/Julian/Fiscal Calendars • Calculated measures (Day # in week, Day # in month, Day # in year, Week # in month, Week # in year, etc.)
  5. 5. Demo • Date_DIM script
  6. 6. Summary • What & Why of Date Dimensions • Date Dimension Benefits • What to Include in Date Dimension
  7. 7. September 20, 2014 on the University of Denver campus! Multiple tracks of sessions Speakers from across the country Great Sponsors Lots of Prizes All of this for FREE! Register @ denversqlsaturday.com Pre-Cons! This year we are offering all day pre-cons on Friday, September 19th at Cherry Creek Presbyterian Church • Getting Started with Biml by Tim Mitchell & Reeves Smith • Murder They Wrote by Jason Brimhall & Wayne Sheffield • A Day of High Availability and Disaster Recovery by Ryan Adams Details and links to register for pre-cons @ denversqlsaturday.com organized by volunteers from Denver SQL Server User Group (denversql.org)
  8. 8. Contact • swake@revgen.com • @stevewake on Twitter • LinkedIn, Google+ • Blog – http://wakebi.com
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×