The Date Dimension in Analysis Services

  • Comments posted to this topic are about the item The Date Dimension in Analysis Services

  • 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

  • Liked it so much I bought the book.

  • 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

    _____________________________________________________________________
  • 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

  • '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.

  • 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.

  • Good article. 🙂

  • 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.

  • 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.

  • I found this article interesting. I feel like we have our Date dimension dialed, but it's always worth reading an article from someone that knows what they're talking about. And sure enough I found some interesting ideas.

    Now, a question for you and for the people hopefully tracking the posts: what's your solution for reusing the code if you end up doing multiple DSV statements or Views? Do you just rebuild the Date Dimension from scratch each time? Do you copy and past the existing Date.dim file and search and replace? How do you maintain that code going forward? I ask partly because I would like to embrace the different date ranges (we have some Facts with 35 years of data, and others with only 1 or 2, for example) but don't really want to maintain 4 different date dimensions.

    Please post thoughts!

    Cheers,

    Rick


    Rick Todd

  • Hi Rick, I create the date dimension from scratch. I never modified the SSAS project files directly (except for a few rare cases), I always use BIDS* to edit/create the SSAS objects. In the current project I put all the DSV queries in an SSMS project and version control it in VSS, in the same solution folder as the SSAS project.

    Kind regards,

    Vincent

    *Occasionally I use AMO.

  • Hi. This article is great. I was just wondering when part 2 might be available. I'm interested in all of the topics listed, but especially the part on "Enabling users to select a date (or month) to be used in calculated measure using 'from date' and 'to date'." Thanks.

  • Hi erin, I sent part 2 on 31st December so hopefully it would be published soon.

    Vincent

  • Thanks and that’s a good article but I have a question though.

    I have 2 dimensions stored in the same SQL table (data mart).

    Data for my date dimension is stored for 2 cycles. Both cycles have a 12 month period. The first cycle is from January to December and the other cycle is from April to March.

    One row is used to store both cycles in the table.

    See below for my dimensionTimeTable:

    DateSeqCalendarDateYr1Yr2Monthname1Yr1MonthNrYr2MonthNrYr1QNrYr2QNr

    200903012009-03-0120092008March03120104

    200903312009-03-3120092008March03120104

    200904012009-04-0120092009April04010201

    I have one time dimensions in the cube with two hierarchies. They are both represented in two hierarchies with each hierarchy representing time cycles mentioned above.

    My problem is that cycle one works fine while measuring anything but cycle2 only measures the current month and does not show any values for previous months.

    Your help regarding above will be appreciated.

    My problem is that

    What you don't know won't hurt you but what you know will make you plan to know better

Viewing 15 posts - 1 through 15 (of 22 total)

You must be logged in to reply to this topic. Login to reply