0% found this document useful (0 votes)
29 views4 pages

Dynamic Sets: Understanding OLAP 2 Responses

Dynamic sets are a feature in SQL Server Analysis Services (SSAS) that allow calculations defined in MDX script on the server to behave the same way as calculated sets defined in MDX queries. They are context-sensitive and adjust based on slicers, unlike static sets. However, Excel 2007 had issues properly supporting dynamic sets, treating them as static by evaluating them against the default members in subselects before slicers were applied, rather than adjusting to slicers as designed. Consultants need to understand feature support in different reporting tools to advise clients appropriately.

Uploaded by

exbis
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views4 pages

Dynamic Sets: Understanding OLAP 2 Responses

Dynamic sets are a feature in SQL Server Analysis Services (SSAS) that allow calculations defined in MDX script on the server to behave the same way as calculated sets defined in MDX queries. They are context-sensitive and adjust based on slicers, unlike static sets. However, Excel 2007 had issues properly supporting dynamic sets, treating them as static by evaluating them against the default members in subselects before slicers were applied, rather than adjusting to slicers as designed. Consultants need to understand feature support in different reporting tools to advise clients appropriately.

Uploaded by

exbis
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Dynamic sets

Understanding OLAP 2 Responses Jul 272009

The reason Im discussing this often mentioned topic is the following. After many hours spent on the analysis how do dynamic sets behave in SSAS front-ends, Ive been asked a perfectly reasonable question: Why do we have dynamic set and when should it be used? I believe this article explains the story behind dynamic sets and their purpose, as well as when and how they should be used. It also warns the reader that the problem is not about the implementation of dynamic sets in SSAS, but about something else. What? Youll see when you read it through. INTRODUCING DYNAMIC SETS SSAS 2005 and 2008 feature MDX script as a place to provide calculations. The reason is obvious concentration of calculations on a server results in better query performance (precomputations, cache, etc.) and easier maintenance. SSAS 2005 MDX script featured cube-based calculated members/sets support. While cube-based calculated members were equivalent in behavior to their query-based counterparts (except for some newly available internal optimization possibilities), cube-bases calculated sets were not. They were useful, but many times that was not enough. They didnt behave exactly the same way query-based sets did and, for many, this was a big issue, because they couldnt provide the same logic in cube as in query. In order to comply to requests, SSAS team introduced new kind of sets in its next version of SSAS dynamic sets. Dynamic sets, unlike static sets, are fully equivalent to calculated sets defined in a query. Which means BI developers were finally able to achieve the same functionality in MDX script as once in query. Its important to notice that sets in SSAS 2005 have not been converted to dynamic, once implemented in SSAS 2008. Today, both versions of sets exist, both are useful. One variant was named STATIC, the other DYNAMIC. And its solely up to a BI developer to prefix them appropriately in their definition. Default are static sets (for historic reasons, 2005->2008 compatibility), which means prefix can be ommited. DESIGN AND USAGE The rule for usage was simple. If a BI developer needs a hardcoded collection of members, which doesnt change no matter what in query/pivot, he/she should use static sets. In all other scenarios, a dynamic set can be used. So, how come there are problems here and there using them?

We said that query-based sets should have their cube-based equivalent. And they do, at least in SSAS 2008. When we implement cube-based sets, we enjoy the comfort of being able to refer to them in any query. Equally so, end-users are able to use them in a pivot table (SSAS front-ends) which is an extra plus. That is unless we hide them, which rarely is the case. Part of our intention is to provide those sets directly to end-users, not just to be able to refer to them in our queries. Dynamic sets are context-sensitive. Not row, not column, just slicer (and subselect) sensitive. Which means that end-users can experiment by slicing them in a pivot table and see how they change. A typical example is Top 10 something set. When defined as dynamic in a cube, it should cover a whole range of scenarios for end-users. Whether sliced by additional attributes or different dimensions, that set should adjust accordingly. A dream come through for any BI developer a cube-based solution covering many reports. Because the best solutions are those covered by design. Just like a pivot table on top of an OLAP cube, a solution-by-design, covering endless T-SQL queries in a relational world. However, not everything went smoothly, at least not on the other side SUPPORTING DYNAMIC SETS Queries are written by BI developers, not end-users. Which means they and their sets are under tight control, hidden and preferably tested enough. Pivot-table in front-ends are not. In contrast, they are fully exposed to end-users and therefore often limited, not just regarding cube-based sets, but other features as well. Why? Its simple, the more you restrict your front-end, the less worries you have later, knowing that potential end-user actions and their combinations are beyond your imagination. One of the common example is hiding MDX you play it safe with your pivot and features you support in it. Each front-end tries to keep things under control by balancing between end-users requests and features it would rather skip than support. In a multidimensional world possibilities are endless and therefore once you had decided to support a SSAS feature, youve opened a Pandoras box whether you know it or not, because everythings related and all features should fit together just fine. Every front-end has these dilemmas do we support this feature, if so in what scope, in what situations, what do we support as additional actions to it, what combinations of existing features are supported with it, etc. (our CubePlayer is no exception there). Its hard to implement everything properly, to foreseen things. Im not saying impossible, but, let say experience plays a big role here. Things went wrong when little by little it became obvious that the favorite front-end of many (also a relatively young one, so we shouldnt be too harsh on it) had a problem with dynamic sets. Cause of the problem? Intense use of subselect. When an end-user placed a set on rows (or columns), a peculiar syntax was formed and that same set also ended in subselect. By now youve must have guessed were talking about Excel 2007.

HOUSTON, WEVE HAD A PROBLEM Each front-end generates one or more MDX statements in the backgroud for every end-user action in its pivot (almost every action). Regardless of areas and their names in the front-ends pivot, which is up to a particular software vendor, there are rows, columns, slicer and subselect areas as 4 basic parts of every MDX query (some of them can be skipped, though). MDX query is the thing that is being sent to SSAS server, so it up to the front-end to properly convert what the end user provided in pivot into a correct MDX. The problem is, there can be several solutions to it. Its all about how to pick the best solution, the one that will work not just in this case, but also with everything we support in our front-end (which brings us back to frontend dilemma). Using the subselect too often as an approach was not a good decision, because dynamic sets, if nothing else, were obviously negleckted. Or not tested properly. The artificial Adventure Works database, a reference for many things, may be misleading (see this SSAS forum thread for more info). Two of those areas, subselect and slicer, are of importance here. They are similar in nature but also quite different. In order not to loose focus here, we will only state whats relevant for dynamic sets the subselect is evaluated before the slicer! SSAS server can be simplified like this. Internally, first it ask what do we have in subselect and then evaluates it. It is important to state here that this evaluation is performed in the context of cube dimensions default members (or another subselect inside it, if they are cascaded, but lets keep things simple). Then the slicer gets evaluated. Then the axes. Then cells, either by blockmode, or cell-by-cell. Finally, NON EMPTY and HAVING operations are performed on axes. Our set is supposed to be on an axis, where the end-user has placed it. That way it would be evaluated after the slicer, adjusting accordingly. Excel 2007 on the other hand placed it in the subselect. It cant be evaluated against the slicer because the slicer doesnt exist yet (its like knowing the future). But what does exist? Default members! Dynamic set placed in subselect is evaluated against cube hierarchies default members. And what is static set evaluated against, in MDX script? Also default members. Which makes dynamic and static sets the same in Excel 2007, both static in nature. CONCLUSION Dynamic sets are implemented just fine in SSAS 2008. That is, they are equal to query-based sets, adjusting to slicer promptly. It is up to the front-end youre going to use on them and its support towards them. Thats where the problems might occur, either because of lack of support, or worse, because of improper support.

Finally, its up to us, consultants, to educate ourselves properly and then communicate with potential users, advising them what is supported and what is not in solutions we intend to implement. The final decision, of course, is clients.

You might also like