<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tags 'Analysis Services' and 'Excel 2007'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=Analysis+Services,Excel+2007&amp;orTags=0</link><description>Search results matching tags 'Analysis Services' and 'Excel 2007'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>DefaultMember, subcubes and non-aggregatable attributes</title><link>http://sqlblog.com/blogs/marco_russo/archive/2007/10/01/defaultmember-subcubes-and-non-aggregatable-attributes.aspx</link><pubDate>Mon, 01 Oct 2007 21:35:41 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:2819</guid><dc:creator>sqlbi</dc:creator><description>&lt;p&gt;Today I discovered that DefaultMember might result in a member other thant the default dimension member.&lt;/p&gt; &lt;p&gt;Reading &lt;a href="http://technet.microsoft.com/en-us/library/ms146050.aspx"&gt;documentation&lt;/a&gt;, I got the idea that DefaultMember would be always the default member defined for a dimension into a cube. In reality, the default member could change into a subcube that excludes the original default member from a calculation. This is important because writing MDX Scripts you cannot anticipate any possible use of your cube... and you should carefully consider when DefaultMember is the real appropriate syntax on a case-by-case basis. You have to be particularly careful whenever you use DefaultMember on a non-aggregatable attribute.&lt;/p&gt; &lt;p&gt;Let's look an example.&lt;/p&gt; &lt;p&gt;In Adventure Works you can write the following query.&lt;/p&gt; &lt;p&gt;&lt;pre&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;WITH&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;MEMBER&lt;/span&gt;&lt;span style="color:#000000;"&gt; Measures.DiffActual 
     &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt;&lt;span style="color:#000000;"&gt; (Scenario.Scenario.&lt;/span&gt;&lt;span style="color:#800000;"&gt;CurrentMember&lt;/span&gt;&lt;span style="color:#000000;"&gt;, Measures.Amount) 
        - (Scenario.Scenario.&lt;/span&gt;&lt;span style="color:#800000;"&gt;&lt;strong&gt;DefaultMember&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;, Measures.Amount)
&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;SELECT&lt;/span&gt;&lt;span style="color:#000000;"&gt; 
{ [Scenario].[Scenario].[Forecast], 
  [Scenario].[Scenario].[Budget] } &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;COLUMNS&lt;/span&gt;&lt;span style="color:#000000;"&gt;,
{ Measures.Amount, Measures.DiffActual } &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;ROWS
FROM&lt;/span&gt;&lt;span style="color:#000000;"&gt; [Adventure Works]&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This query provides this result:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/DefaultMembersubcubesandnonaggregatablea_85E/image.png"&gt;&lt;img alt="image" src="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/DefaultMembersubcubesandnonaggregatablea_85E/image_thumb.png" border="0"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I'm not interested in the real meaning of this query. This is only an excuse to see the &lt;em&gt;DefaultMember&lt;/em&gt; in action against a non-aggregatable attribute. The &lt;em&gt;DiffActual&lt;/em&gt; calculated member has a formula that use &lt;em&gt;Scenario.Scenario.DefaultMember&lt;/em&gt;. The default member for Scenario.Scenario attribute is Actual. The DiffActual row shows the difference between the scenario in column and the Actual scenario.&lt;/p&gt;
&lt;p&gt;Now, if we encapsulate the previous query into a subquery that apparently should return the same members, we can write this query.&lt;/p&gt;
&lt;p&gt;&lt;pre&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;WITH&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;MEMBER&lt;/span&gt;&lt;span style="color:#000000;"&gt; Measures.DiffActual 
     &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt;&lt;span style="color:#000000;"&gt; (Scenario.Scenario.&lt;/span&gt;&lt;span style="color:#800000;"&gt;CurrentMember&lt;/span&gt;&lt;span style="color:#000000;"&gt;, Measures.Amount) 
        - (Scenario.Scenario.&lt;/span&gt;&lt;span style="color:#800000;"&gt;&lt;strong&gt;DefaultMember&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;, Measures.Amount)
&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;SELECT&lt;/span&gt;&lt;span style="color:#000000;"&gt; 
{ [Scenario].[Scenario].[Forecast], 
  [Scenario].[Scenario].[Budget] } &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;COLUMNS&lt;/span&gt;&lt;span style="color:#000000;"&gt;,
{ Measures.Amount, Measures.DiffActual } &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;ROWS
FROM&lt;/span&gt;&lt;span style="color:#000000;"&gt; 
  (&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;SELECT&lt;/span&gt;&lt;span style="color:#000000;"&gt; 
    { [Scenario].[Scenario].[Forecast], 
      [Scenario].[Scenario].[Budget] } &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;COLUMNS
FROM&lt;/span&gt;&lt;span style="color:#000000;"&gt; [Adventure Works])
&lt;p&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;/pre&gt;
&lt;p&gt;Before executing this query, what is the expected result? First time I thought "it should be the same", but in reality it is different, like shown here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/DefaultMembersubcubesandnonaggregatablea_85E/image_2.png"&gt;&lt;img alt="image" src="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/DefaultMembersubcubesandnonaggregatablea_85E/image_thumb_2.png" border="0"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;What happened? Simply, the SSAS calculation engine needs a default member included in the "context"&amp;nbsp;- when you use a subquery, you are defining a subset of the cube space that must have an existing&amp;nbsp;default member for each attribute -&amp;nbsp;if a default&amp;nbsp;member is outside of the&amp;nbsp;subcube, it is replaced by another member of the same attribute.&lt;/p&gt;
&lt;p&gt;In&amp;nbsp;the case we are&amp;nbsp;exmining, the default member of the subcube becomes Forecast.&amp;nbsp;This default member depends on the order of members of the same attribute used in the subcube. If we invert Forecast and Budget members only in the subcube, the default member becomes Forecast instead of Budget, changing the calculated member result (based on DefaultMember syntax).&lt;/p&gt;
&lt;p&gt;&lt;pre&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;WITH&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;MEMBER&lt;/span&gt;&lt;span style="color:#000000;"&gt; Measures.DiffActual 
     &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt;&lt;span style="color:#000000;"&gt; (Scenario.Scenario.&lt;/span&gt;&lt;span style="color:#800000;"&gt;CurrentMember&lt;/span&gt;&lt;span style="color:#000000;"&gt;, Measures.Amount) 
        - (Scenario.Scenario.&lt;/span&gt;&lt;span style="color:#800000;"&gt;DefaultMember&lt;/span&gt;&lt;span style="color:#000000;"&gt;, Measures.Amount)
&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;SELECT&lt;/span&gt;&lt;span style="color:#000000;"&gt; 
{ [Scenario].[Scenario].[Forecast], 
  [Scenario].[Scenario].[Budget] } &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;COLUMNS&lt;/span&gt;&lt;span style="color:#000000;"&gt;,
{ Measures.Amount, Measures.DiffActual } &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;ROWS
FROM&lt;/span&gt;&lt;span style="color:#000000;"&gt; 
  (&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;SELECT&lt;/span&gt;&lt;span style="color:#000000;"&gt; 
    { &lt;strong&gt;[Scenario].[Scenario].[Budget], 
      [Scenario].[Scenario].[Forecast]&lt;/strong&gt; } &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;COLUMNS
FROM&lt;/span&gt;&lt;span style="color:#000000;"&gt; [Adventure Works])
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="color:#000000;"&gt;This is the result for the query above:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;a href="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/DefaultMembersubcubesandnonaggregatablea_85E/image_3.png"&gt;&lt;img alt="image" src="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/DefaultMembersubcubesandnonaggregatablea_85E/image_thumb_3.png" border="0"&gt;&lt;/a&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#000000;"&gt;To avoid this issue you can use a specific member instead of the keyword DefaultMember. In our example, the solution is:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;WITH&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;MEMBER&lt;/span&gt;&lt;span style="color:#000000;"&gt; Measures.DiffActual 
     &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt;&lt;span style="color:#000000;"&gt; (Scenario.Scenario.&lt;/span&gt;&lt;span style="color:#800000;"&gt;CurrentMember&lt;/span&gt;&lt;span style="color:#000000;"&gt;, Measures.Amount) 
        - (&lt;strong&gt;Scenario.Scenario.[Actual], &lt;/strong&gt;Measures.Amount)
&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;SELECT&lt;/span&gt;&lt;span style="color:#000000;"&gt; 
{ [Scenario].[Scenario].[Forecast], 
  [Scenario].[Scenario].[Budget] } &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;COLUMNS&lt;/span&gt;&lt;span style="color:#000000;"&gt;,
{ Measures.Amount, Measures.DiffActual } &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;ROWS
FROM&lt;/span&gt;&lt;span style="color:#000000;"&gt; [Adventure Works]
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;With this syntax, any use of this query as a subcube in another query will not have the side effects we have seen before.&lt;/p&gt;
&lt;p&gt;Why this is so important? Simply because Excel 2007, often used as a client by end users, makes heavy use of subqueries in MDX generated by PivotTable. I had to substitute all DefaultMember in MDX Scripts with well-known member names (this also affects my &lt;a href="http://sqlblog.com/blogs/marco_russo/archive/2007/09/02/datetool-dimension-an-alternative-time-intelligence-implementation.aspx"&gt;DateTool&lt;/a&gt; dimension, which I will update soon with this and other improvements).&lt;/p&gt;
&lt;p&gt;Final note: a special thanks to &lt;a href="http://sqlblog.com/blogs/mosha/"&gt;Mosha Pasumansky&lt;/a&gt;&amp;nbsp;for illuminating me on hidden secrets of DefaultMember. Mosha also said that using the member name of default member (instead of DefaultMember keyword) improves query performance.&lt;span style="color:#000000;"&gt;&lt;/p&gt;&lt;/span&gt;</description></item><item><title>DateTool dimension: an alternative Time Intelligence implementation</title><link>http://sqlblog.com/blogs/marco_russo/archive/2007/09/02/datetool-dimension-an-alternative-time-intelligence-implementation.aspx</link><pubDate>Sun, 02 Sep 2007 13:41:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:2421</guid><dc:creator>sqlbi</dc:creator><description>&lt;P&gt;Year-To-Date and Difference-Over-Previos-Year (or Year-Over-Year Growth) are among the most required features of any user. Some OLAP client (like ProClarity) offers features that try to solve this problem client-side, but I don’t like this approach given that you might have a server-side feature doing that (so you don’t discriminate Excel users). 
&lt;P&gt;One trivial approach is creating a calculated measure for each combination of measure and date-calculation. While this works, it results in a multiplication of the number of measures, making the cube hard to use. Analysis Services offers a feature called Time Intelligence Wizard that creates some calculated members on dedicated Date attributes. This works in MDX but has several limitations: 
&lt;P&gt;· It limits the measures on which the calculation are applied (each time you add a new measure, you need to update the wizard-generated MDX scripts) 
&lt;P&gt;· It only applies to selected hierarchies – it doesn’t work, for example, if you cross Month and Years on rows and columns. 
&lt;P&gt;· It doesn’t work well with Excel 2007 after you install Analysis Services 2005 SP2 – see my rants &lt;A href="http://sqlblog.com/blogs/marco_russo/archive/2007/05/26/is-microsoft-serious-about-bi.aspx"&gt;here&lt;/A&gt;. 
&lt;P&gt;While the first two issues can be solved by using the same architectural approach of Time Intelligence Wizard, simply writing a different MDX Scripts, solving the third issue (Excel 2007 compatibility) requires a different architecture. For the sake of Google/MSN Live desperate users, I’m going to describe “&lt;STRONG&gt;how to make calculated members working on non-measures dimension with Analysis Services 2005 SP2 and Excel 2007&lt;/STRONG&gt;”. I hope that Microsoft will consider a similar approach on a future version of Time Intelligence Wizard… 
&lt;P&gt;You can download the solution I'm going to describe on SQLBI.EU web site, under &lt;A href="http://www.sqlbi.eu/datetool.aspx"&gt;DateTool Project&lt;/A&gt;. 
&lt;H3&gt;The issue&lt;/H3&gt;
&lt;P&gt;Let’s start describing the Excel 2007 SP2 issue. I created a small subset of Adventure Works sample cube. Calendar Date Calculations is the wizard-generated attribute. With BIDS browser (built using OWC 11) you can put this dimension on the columns of a pivot table with Calendar hierarchy placed on rows, and you can select any set of members from the Calendar Date Calculations attribute. In this example I unchecked one of the members generated by Time Intelligence Wizard. 
&lt;P&gt;&lt;A href="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG01%20-%20Calendar%20Date%20PivotTable%20OWC11.png"&gt;&lt;IMG height=450 alt="FIG01 - Calendar Date PivotTable OWC11" src="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG01%20-%20Calendar%20Date%20PivotTable%20OWC11_thumb.png" width=862 border=0&gt;&lt;/A&gt; 
&lt;P&gt;With Excel 2007 the same cube is usable only if you enable the “Show calculated members from OLAP server” on the PivotTable Options dialog box (it’s unchecked by default). 
&lt;P&gt;&lt;A href="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG02%20-%20PivotTable%20options%20for%20Show%20Calculated%20Members.png"&gt;&lt;IMG alt="FIG02 - PivotTable options for Show Calculated Members" src="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG02%20-%20PivotTable%20options%20for%20Show%20Calculated%20Members_thumb.png" border=0&gt;&lt;/A&gt; 
&lt;P&gt;Now we can generate a PivotTable similar to the one generated with BIDS browser. 
&lt;P&gt;&lt;A href="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG03%20-%20Excel%202007%20PivotTable%20Time%20Intelligence%20Wizard.png"&gt;&lt;IMG height=279 alt="FIG03 - Excel 2007 PivotTable Time Intelligence Wizard" src="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG03%20-%20Excel%202007%20PivotTable%20Time%20Intelligence%20Wizard_thumb.png" width=736 border=0&gt;&lt;/A&gt; 
&lt;P&gt;Unfortunately, we cannot select single members from the Calendar Date Calculations attribute. We only have an “all or nothing” option based on the PivotTable Options settings we’ve seen above. This is the resulting Excel 2007 PivotTable. 
&lt;P&gt;&lt;A href="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG04%20-%20Excel%202007%20calculated%20members%20cannot%20be%20unchecked.png"&gt;&lt;IMG alt="FIG04 - Excel 2007 calculated members cannot be unchecked" src="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG04%20-%20Excel%202007%20calculated%20members%20cannot%20be%20unchecked_thumb.png" border=0&gt;&lt;/A&gt; 
&lt;H3&gt;The solution&lt;/H3&gt;
&lt;P&gt;I defined a dedicated dimension for time-related calculated members. Each formula has its own “real” members, instead of calculated ones. This solves the Excel 2007 issue at the price to require a dimension process instead of a simple MDX deployment (changing MDX Scripts for new calculated members wouldn’t require cube reprocessing). Since I don’t want a cube space growth, I simply put the dimension in the cube without a relationship with any measure group. 
&lt;P&gt;&lt;A href="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG05%20-%20Dimension%20Usage%20for%20DateTool%20dimension.png"&gt;&lt;IMG height=318 alt="FIG05 - Dimension Usage for DateTool dimension" src="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG05%20-%20Dimension%20Usage%20for%20DateTool%20dimension_thumb.png" width=376 border=0&gt;&lt;/A&gt; 
&lt;P&gt;This is the real tricky and most non-intuitive part of the game. The DateTool dimension is seen as a regular dimension by any client, but it can be changed and reprocessed without any need to reprocess any measure group (because it has no relationship!). 
&lt;P&gt;The DateTool dimension could contain a single attribute with all time-related calculated members. However, I prefer an approach that uses two sets of different calculated members, which are orthogonal and might be crossed together. For example, I would put Year-To-Date calculation in one attribute and Year-Over-Year Growth in another one, so that I can obtain the Year-Over-Year Growth of a Year-To-Date calculation without the need to create a dedicated calculated member. In other words, I use these two sets to separate &lt;I&gt;aggregations&lt;/I&gt; from &lt;I&gt;comparisons&lt;/I&gt; formulas. 
&lt;P&gt;In practice, I would need two independent dimensions, and I do that from a relational point of view. I define two views in a separate schema on my data source (I could also use a separate Data Source View with self-contained named queries, but I prefer using relational views as a general way to decouple relational schema from multidimensional one – reasons for this would fill a whole dedicated article). &lt;PRE&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;CREATE&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;SCHEMA&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; DateTool
GO

&lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;CREATE&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;VIEW&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; [DateTool]&lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt;[DateAggregation] &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS
SELECT&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; 0 &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; ID_Aggregation&lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#ff0000;"&gt;'Regular'&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; Aggregation
&lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;UNION ALL
SELECT&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; 1 &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; ID_Aggregation&lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#ff0000;"&gt;'Year To Date'&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; Aggregation
&lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;UNION ALL
SELECT&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; 2 &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; ID_Aggregation&lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#ff0000;"&gt;'Last 12 Months'&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; Aggregation
&lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;UNION ALL
SELECT&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; 3 &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; ID_Aggregation&lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#ff0000;"&gt;'Total Current Year'&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; Aggregation
GO

&lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;CREATE&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;VIEW&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; [DateTool]&lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt;[DateComparison] &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS
SELECT&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; 0 &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; ID_Comparison&lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#ff0000;"&gt;'Regular'&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; Comparison
&lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;UNION ALL
SELECT&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; 1 &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; ID_Comparison&lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#ff0000;"&gt;'Previous Year'&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; Comparison
&lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;UNION ALL
SELECT&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; 2 &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; ID_Comparison&lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#ff0000;"&gt;'Diff. Over Previous Year'&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; Comparison
&lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;UNION ALL
SELECT&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; 3 &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; ID_Comparison&lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#ff0000;"&gt;'Diff. % Over Previous Year'&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; Comparison
GO

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Since I want to build a single dimension with two attributes, I create another view to build a junk dimension with the desired cardinality. &lt;PRE&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;CREATE&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;VIEW&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; [DateTool]&lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt;[DateTool] &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS
SELECT&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; 
    a&lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt;ID_Aggregation&lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; 
    s&lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt;ID_Comparison&lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; 
    &lt;/SPAN&gt;&lt;SPAN style="COLOR:#ff00ff;"&gt;CAST&lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; ID_Comparison &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;VARCHAR&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#ff0000;"&gt;' - '&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#ff00ff;"&gt;CAST&lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; ID_Aggregation &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;VARCHAR&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#0000ff;"&gt;Description
FROM&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; DateTool&lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt;DateAggregation a
&lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;CROSS&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;JOIN&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt; DateTool&lt;/SPAN&gt;&lt;SPAN style="COLOR:#808080;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="COLOR:#000000;"&gt;DateComparison s
GO
&lt;/PRE&gt;
&lt;P&gt;&lt;/SPAN&gt;At this point I can import these views in the Data Source View. I specify Primary Keys and Relationships manually because they can’t be inferred by relational metadata (they don’t exist at that level). &lt;/P&gt;
&lt;P&gt;&lt;A href="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG06%20-%20DateTool%20Data%20Source%20View.png"&gt;&lt;IMG alt="FIG06 - DateTool Data Source View" src="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG06%20-%20DateTool%20Data%20Source%20View_thumb.png" border=0&gt;&lt;/A&gt; 
&lt;P&gt;The resulting DateTool dimension is very simple. 
&lt;P&gt;&lt;A href="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG07%20-%20DateTool%20Data%20Dimension.png"&gt;&lt;IMG alt="FIG07 - DateTool Data Dimension" src="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG07%20-%20DateTool%20Data%20Dimension_thumb.png" border=0&gt;&lt;/A&gt; 
&lt;P&gt;At this point there is the necessary MDX Script that solves all DateTool members. This single part would require another post or two and I don’t have time to explain that now, but you can see the complete AdventureWorks based solution downloading it from SQLBI.EU. 
&lt;P&gt;The interesting part is the result provided by Excel 2007 with this solution. Here is an example of the Calendar hierarchy crossed with a selection of the calculated members available in the Aggregation attribute of the DataTool dimension. 
&lt;P&gt;&lt;A href="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG08%20-%20Excel%202007%20DataTool.Aggregation%20sample.png"&gt;&lt;IMG alt="FIG08 - Excel 2007 DataTool.Aggregation sample" src="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG08%20-%20Excel%202007%20DataTool.Aggregation%20sample_thumb.png" border=0&gt;&lt;/A&gt; 
&lt;P&gt;With this dimension, there are no limitations like those involved by calculated members (see the previous example made using Time Intelligence Wizard). In the previous PivotTable there is a member unchecked, like you can see in the following picture. 
&lt;P&gt;&lt;A href="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG09%20-%20Excel%202007%20DataTool.Aggregation%20selection.png"&gt;&lt;IMG alt="FIG09 - Excel 2007 DataTool.Aggregation selection" src="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG09%20-%20Excel%202007%20DataTool.Aggregation%20selection_thumb.png" border=0&gt;&lt;/A&gt; 
&lt;P&gt;Just using this technique you could translate each calculated measure generated by Time Intelligence Wizard into a “regular” dimension fully usable by Excel 2007 users. The presence of two independent attributes makes the user able to build more complex PivotTables like the following one: the highlighted column displays the Year Over Year Growth over the Year To Date value. 
&lt;P&gt;&lt;A href="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG10%20-%20Excel%202007%20DataTool.Aggregation%20cross%20YTD-grow_1.png"&gt;&lt;IMG height=639 alt="FIG10 - Excel 2007 DataTool.Aggregation cross YTD-grow" src="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG10%20-%20Excel%202007%20DataTool.Aggregation%20cross%20YTD-grow_thumb_1.png" width=628 border=0&gt;&lt;/A&gt; 
&lt;P&gt;Undoubtedly, such a feature is comfortable more to advanced users that to inexperienced one, since often a rename of the resulting report is required to better describe query results. 
&lt;P&gt;Finally, one of the limitations of Time Intelligence Wizard is that generated formulas work on a limited part of the cube: only one time hierarchy and only a selected set of measures. With the MDX Scripts I used, there are no similar constraints, making the cube easier to navigate. In the following example, I put years on columns and months on rows, displaying the Year-To-Date value and the difference with the previous year for selected data. 
&lt;P&gt;&lt;A href="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG11%20-%20Excel%202007%20Year%20cross%20months.png"&gt;&lt;IMG alt="FIG11 - Excel 2007 Year cross months" src="http://sqlblog.com/blogs/marco_russo/WindowsLiveWriter/a51869fd5812_E5C0/FIG11%20-%20Excel%202007%20Year%20cross%20months_thumb.png" border=0&gt;&lt;/A&gt; 
&lt;P&gt;Unfortunately, with this approach we lose compatibility with other clients, like the Browser provided by BIDS and SQL Server Management Studio. A PivotTable like the previous one would not display any data: the different way Excel 2007 and OWC 11 manage dimensions metadata produces this discrepancy between results obtained by difference OLAP clients. I am not sure if this can be solved just changing MDX Scripts definition – I made many tests until now and I described the best compromise I obtained until now, but I’d like to get feedback about issues, possible improvements and eventually alternative architectural solutions. 
&lt;P&gt;If you have time to &lt;A href="http://www.sqlbi.eu/datetool.aspx"&gt;take a look at the solution&lt;/A&gt;, please send me your feedback and/or any other comments at marco.russo (at) sqlbi.eu or using the comments for this post.&lt;/P&gt;</description></item><item><title>SSAS 2005 SP2 breaks Excel calculated member selection</title><link>http://sqlblog.com/blogs/marco_russo/archive/2007/03/07/ssas-2005-sp2-breaks-excel-calculated-member-selection.aspx</link><pubDate>Wed, 07 Mar 2007 20:25:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:935</guid><dc:creator>sqlbi</dc:creator><description>&lt;P&gt;After many tries, today I came to the conclusion that Analysis Services 2005 SP2 breaks the Excel 2007 calculated member selection feature. I already talked about this issue &lt;A href="http://sqlblog.com/blogs/marco_russo/archive/2007/01/31/excel-2007-pivottable-with-calculated-members.aspx"&gt;here&lt;/A&gt;, but today I found&amp;nbsp;the way to reproduce the error.&lt;/P&gt;
&lt;P&gt;This is a scenario that works well:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Analysis Services 2005 SP1 + hotfixes (build 2153)&lt;/LI&gt;
&lt;LI&gt;Excel 2007 RTM&lt;/LI&gt;
&lt;LI&gt;Cube with several calculated members on a hierarchy or attribute (not on measures)&lt;/LI&gt;
&lt;LI&gt;When you build a pivot table with Excel, you can freely select single calculated members from the hierarchy or attribute.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Adding Analysis Services 2005 SP2 &lt;U&gt;even only on the server&lt;/U&gt;, you get &lt;STRONG&gt;all&lt;/STRONG&gt; the calculated members of the hierarchy or attribute selected, and they are all always visible.&lt;/P&gt;
&lt;P&gt;In my opinion, this is a breaking change of SP2. I don't see any reason for this behavior. Remember, is is suffice to update the server to break calculated member selection on any Excel 2007 client, regardless of the client component version you use.&lt;/P&gt;
&lt;P&gt;I posted a bug &lt;A href="https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=262197"&gt;here&lt;/A&gt;: please vote the bug to get an higher rating if you think (like me) that this requires a promptly response&amp;nbsp;from Microsoft.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;UPDATE February 20, 2010: SQL Server 2008 R2 and Excel 2010 have solved the issue - you need both. Chris Webb posted a &lt;A href="http://cwebbbi.spaces.live.com/Blog/cns!7B84B0F2C239489A!6257.entry"&gt;description of the fix&lt;/A&gt;.&lt;/STRONG&gt;&lt;/P&gt;</description></item></channel></rss>