Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Purpose and effect of SSAS hierarchies?

Tags:

ssas

Firstly, I feel comfortable with what a hierarchy is in terms of the concept and how it impacts the design of a DW's star schema. I have some dimensions with lots of attributes, and I could create lots of hierarchies within SSAS. I would like a better understanding of how the OLAP engine uses the hierarchies that I create so that I can make a more informed decision on how I design my hierarchies(that's a tough word to type the first few times). There are also limitations with SSAS regarding attributes appearing in multiple hierachies so sometimes I have to do extra work to work around those limitations or decide which hierarchy is more important.

I also wonder what negative impacts a hierarchy might have, such as making the dimension more confusing for users. I might hide the attributes which are included in hierarchies to eliminate the duplicate attribute and make the dimension less confusing. But then a user wants to see which months of the year they typically get more sales. If I've hidden the month attribute so that it is only available through a Year->Month hierarchy, are they forced to always include the Year part of the hierarchy, preventing them from doing such analysis?

I few articles on hierarchies have stated something to the effect of "allowing the user to drill down to detailed data". Which is misleading, because you can simply drag the separate year and month attributes to a report and you've accomplished just that without the use of a hierarchy. So such an explanation is a little superficial. I feel like there must be a lot more to it than that.

Some articles seem to suggest it determines whether or not attributes are considered for aggregation. This seems counter intuitive, because I thought that already occurs when you included an attribute in a cube. I mean the whole point of creating a cube consisting of attributes, is to have an intersection of all of the attributes so that you can quickly aggregate on any combination of them, so it confuses me when something implies the opposite of that by saying only attributes in hierarchies are considered for aggregation:

Attributes only exposed in attribute hierarchies[as opposed to user hierarchies] are not automatically considered for aggregation by the Aggregation Design Wizard. Queries involving these attributes are satisfied by summarizing data from the primary key. Without the benefit of aggregations, query performance against these attributes hierarchies can be slow. -SSAS 2008 Performance Guide

Can someone explain how the engine uses my hierarchies in contrast with just including the attribute in the cube? (besides the aesthetics of grouping attributes together)

Unnatural hierarchies are confusing as heck to me in particular. In the SSAS 2008 Performance Guide they show one example as a Gender->Education hierarchy. I think my users would mumble "stupid programmer" every time they had to drill through Gender just to get to Education.

What rational do you follow on when and when not to create a hierarchy?

like image 232
AaronLS Avatar asked Aug 29 '11 21:08

AaronLS


People also ask

What is SSAS hierarchy?

Hierarchies. Hierarchies are a useful tool in SSAS to reduce complexity between attributes and guide users into a certain drill-down behavior.

What is ragged hierarchy in data warehouse?

A ragged hierarchy can represent a geographic hierarchy in which the meaning of each level such as city or country is used consistently, but the depth of the hierarchy varies. Figure 1 shows a geographic hierarchy that has Continent, Country, Province/State, and City levels defined.

What is attribute in SSAS?

An Attribute Hierarchy is a Hierarchy created by SQL Server Analysis Services for every Attribute in a Dimension by default. An Attribute by default contains only two levels - An "All" level and a "Detail" level which is nothing but the Dimension Members.

How many dimensions are there in SSAS?

In SSAS, dimensions are of two types, such as Database Dimension and Cube Dimension.


1 Answers

Not sure 100% the comments I will say applies to SSAS, but as we're both 100% MDX/XMLA compatible it's similar.

You may start by reading this and the many-to-many documentation.

The first difference between using hierarchies with levels and attributes is performance. You've two different scenarios for a drilldown (take [Asia] as a particular member and let's find all countries of [Asia]):

  • Using hierarchy with levels : [Asia].children()
  • Using attributes : ([Asia],[Countries])

The first option is trivial and very fast (the structure is in memory). The second one implies iterating though all countries and 'check' if they exist (aka are countries of [Asia]). This can be a pain for huge attributes (>100k). Once done, we need to go to our fact tables where each members has a set of associated fact rows. The version with a single hierarchy is again direct. The one with two might imply some additional internal operations -> all rows of [Asia] minus the ones of a particular country. Simplified version is also more handy for the cache.

Second, you define a 'natural' drilldown path that can be directly used in the GUI.

On top, you can add special aggregations types (First,Last, Min, Max...) that will take into account the structure of a given hierarchy.

There are successfully OLAP solutions that work without hierarchical structures but you've less features to play with for making a solution.

I hope it helps you understand these concepts better.

like image 147
ic3 Avatar answered Oct 14 '22 04:10

ic3