|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Monday, January 03, 2011 8:48 AM
Points: 26,
Visits: 71
|
|
Bob Hovious (12/17/2008) Could you give us a real world example or two using other dimensions besides day?
I have worked with large data warehouse applications that do a lot of data aggregation. The ability to roll data up into non-day increments (hours, months, quarters and years) is useful in those applications. It allows you to store the aggregated data referenced by a single time coordinate. I'm not suggesting that a set of data be linked to ALL dimensions. So you wouldn't link a record to the year 2008, Quarter 1, Month 10 and day 10 if it was 10-OCT-2008. But if you do periodical aggregation as the need for granularity decreases as data ages, the ability to use a single value to represent that can be useful.
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Monday, January 03, 2011 8:48 AM
Points: 26,
Visits: 71
|
|
TheSQLGuru (12/17/2008) It is customary and useful to have your int date keys be formatted CCYYMMDD, at least in the classical date dimension scenario. Identities are really not helpful here.
What format would you propose for the quarterly and hourly values?
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Today @ 3:22 PM
Points: 3,678,
Visits: 5,177
|
|
I had zoned out when I posted that this date table is more granular than day.
Best,
Kevin G. Boles SQL Server Consultant SQL MVP 2007-2012 TheSQLGuru at GMail
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 3:23 PM
Points: 2,969,
Visits: 10,618
|
|
Here is another approach on the link below. Function F_TABLE_DATE is a multistatement table-valued function that returns a table containing a variety of attributes of all dates from @FIRST_DATE through @LAST_DATE. It was intended mainly to be able to load a date table, but is can also be used directly in a statement for those occasions when you want to go outside your standard ranges.
This function has about 65 columns representing just about every date attribute I have ever had any need for. It does not include any Fiscal period attributes, since that is something that is usually specific to a particular organization.
Date Table Function F_TABLE_DATE http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61519
|
|
|
|