SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


The Date Dimension in Analysis Services


The Date Dimension in Analysis Services

Author
Message
VincentRainardi
VincentRainardi
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1315 Visits: 191
Comments posted to this topic are about the item The Date Dimension in Analysis Services
Calvin Lawson
Calvin Lawson
Hall of Fame
Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)

Group: General Forum Members
Points: 3550 Visits: 102
Great article, Vincent, though I found the non-date musings WAY, WAY more interesting that the actual information on the date dimension. I'm in a project right now where we don't have FK relationships in the datamart, and this surprised me. Nice to know I'm not crazy to think it odd, though.

Keep up the writing and the great tips!

Signature is NULL
SQL-DBA
SQL-DBA
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1395 Visits: 466
Liked it so much I bought the book.
Zanoni Labuschagne-766625
Zanoni Labuschagne-766625
SSC Journeyman
SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)

Group: General Forum Members
Points: 97 Visits: 75
Good, solid article on the date dimension.

I love role-playing dimensions - they can expand business users' understanding of their data to points that they had never considered.

For example, one of the solutions I had implemented was a warehouse for a medical insurer. On the date dimension, I added an attribute called "Season", which would have members like "Summer", "Autumn", "Winter", and "Spring".

Initially they only wanted to track the seasonality of certain treatments e.g. do people visit GP's more in winter than in summer?

BUT

One day they were slicing and dicing, and suddenly they saw they could use the same date dimension to track policy movements - they could see e.g. that more clients would join in autumn (just before the winter) compared to other seasons... Suddenly they had another perspective on their data, and his new view would have an impact on their marketing campaigns...

The date dimension is an absolute treasure in BI solutions, and allows analysts to bring together data, and gain real insight, into the movements of their business


_____________________________________________________________________
Select 'Remember, we were all newbies once'
From Truth
Order by Experience

_____________________________________________________________________

Mike C
Mike C
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10602 Visits: 1173
Got the book, reading it now. Great stuff!

I have a question for you though - I like to have a very large date dimension because the date ranges I deal with can be very long. In fact, they can cover up to 70 years of historical dates (throw in an additional +20, 30, 40 years for future dates). Not all dates fall in this range though, some might only cover a range of -20 to +20 years from the current year. When I role play with the same date dimension (-70 to +40 years for instance), SSAS pumps way too many dates into the cube with no data in them. What's your advice for limiting the date ranges for different date values?

Thanks, and again great article!

Mike C
Piers Williams
Piers Williams
SSC Journeyman
SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)

Group: General Forum Members
Points: 90 Visits: 56
'Although BIDS 2008 advised to hide the attributes used in the hierarchy, in my experience some users would still prefer to see those attributes. This enables them to use (for example) the month attribute directly either as a slicer or filter, without navigating through the Year-Month-Date hierarchy.'

But surely the point here is that users always get massively confused between the month attribute and the month-of-year attribute. Making month only appear as part of the year-month-date heirachy makes it's this-is-a-specific-month role much clearer, leaving the month-of-year to be used as a slicer, which is normally what people want.
VincentRainardi
VincentRainardi
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1315 Visits: 191
Dear all, I'd like to thank you all for reading this article and also for your comments.

Hi Mike, when different ranges are required we can create several Named Queries with different WHERE clauses and then create a date dimension for each Named Query.

Hi Piers, you are right, sometimes users get confused between month and month-in-year and making month as part of the hierarchy avoids this confusion.
Anipaul
Anipaul
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12619 Visits: 1407
Good article. Smile



Mike C
Mike C
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10602 Visits: 1173
Vincent Rainardi (11/29/2008)
Dear all, I'd like to thank you all for reading this article and also for your comments.

Hi Mike, when different ranges are required we can create several Named Queries with different WHERE clauses and then create a date dimension for each Named Query.

Hi Piers, you are right, sometimes users get confused between month and month-in-year and making month as part of the hierarchy avoids this confusion.


OK thanks. Is there an advantage (performance-wise or other) to using SSAS Named Queries over doing it in a SQL view? I was thinking of using a SQL view with some table-driven logic built in to limit the date ranges to the min and max ranges for a specific column/attribute.
VincentRainardi
VincentRainardi
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1315 Visits: 191
Hi Mike, using named queries gives us more flexibility, i.e. we can modify the cube without modifying the database structure. Using views gives performance improvements (processing time) if there are many joins and grouping in the SQL, involving large amount of source rows (>10m) and the views are indexed. For example, a complex DSV SQL for a large measure group could benefit from an indexed view. For a date dimension sourced from a single table with 40k rows I don't think there will be differences on performance between named query and view. What I meant with performance here is the cube processing time; OLAP query time is not affected either way, unless it is a ROLAP partition.

Another advantage of using views is code maintainability. It is beneficial in situations where the cube has many partitions and the partition source SQL queries are complex (long). The SQL queries for these partitions are almost identical except the WHERE clause used for partitioning. Putting these queries on a view would make them easier to maintain. For example, to add a measure we would only need to modify 1 view, rather than modifying the SQL on each partition.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search