<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" version="2.0">
  <channel>
    <title>Miky Schreiber's Blog - BI|MDX</title>
    <link>http://www.miky-schreiber.com/Blog/</link>
    <description>Business Intelligence, Analysis Services, MDX, DataWarehousing and more...</description>
    <language>en-us</language>
    <copyright>Miky Schreiber</copyright>
    <lastBuildDate>Wed, 03 Mar 2010 17:01:11 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.9.6264.0</generator>
    <managingEditor>miky@zahav.net.il</managingEditor>
    <webMaster>miky@zahav.net.il</webMaster>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=d5f658b0-f87f-4975-ad06-f878d99b6301</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,d5f658b0-f87f-4975-ad06-f878d99b6301.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,d5f658b0-f87f-4975-ad06-f878d99b6301.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=d5f658b0-f87f-4975-ad06-f878d99b6301</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Non Empty Behavior is a very good optimization method you can use with your calculated
measures. It allows you to define a list of measures that their emptiness defines
the emptiness of your calculated measure. To understand this, look at the picture
(taken from the <a href="http://msdn.microsoft.com/en-us/library/ms166568.aspx">MSDN</a>):
</p>
        <p>
          <img src="http://www.miky-schreiber.com/Blog/content/binary/NonEmptyBehavior.gif" border="0" />
        </p>
        <p>
This is the calculation expressions pane from the Calculations tab in the cube designer.
From MSDN:
</p>
        <p>
"<span class="Apple-style-span" style="WORD-SPACING: 0px; FONT: 16px 'Times New Roman'; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span class="Apple-style-span" style="FONT-SIZE: 11px; LINE-HEIGHT: 15px; FONT-FAMILY: Verdana">The
measures you specify in the<span class="Apple-converted-space"> </span><strong>Non-empty
behavior</strong><span class="Apple-converted-space"> </span>list are used to
resolve NON EMPTY queries in MDX. When you specify one or more measures in the<span class="Apple-converted-space"> </span><strong>Non-empty
behavior</strong><span class="Apple-converted-space"> </span>list, Analysis Services
treats the calculated member as empty if all the specified measures are empty. If
the<span class="Apple-converted-space"> </span><strong>Non-empty behavior</strong><span class="Apple-converted-space"> </span>property
is blank, Analysis Services must evaluate the calculated member itself to determine
whether the member is empty.</span></span>"
</p>
        <p>
This is not new. NEB is quite old feature in SSAS. The new thing (at least for me)
is that NEB can also be used in Panorama formulas! For example, M1+M2 /*NONEMPTY_BEHAVIOR={M1,M2}*/
will apply M1 &amp; M2 as NEB. You can see more Panorama optimization methods <a href="http://tech.panorama.com/index.php/category-table/367-a">here</a>.
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=d5f658b0-f87f-4975-ad06-f878d99b6301" />
      </body>
      <title>Non Empty Behavior in Panorama</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,d5f658b0-f87f-4975-ad06-f878d99b6301.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,d5f658b0-f87f-4975-ad06-f878d99b6301.aspx</link>
      <pubDate>Wed, 03 Mar 2010 17:01:11 GMT</pubDate>
      <description>&lt;p&gt;
Non Empty Behavior is a very good optimization method you can use with your calculated
measures. It allows you to define a list of measures that their emptiness defines
the emptiness of your calculated measure. To understand this, look at the picture
(taken from the &lt;a href="http://msdn.microsoft.com/en-us/library/ms166568.aspx"&gt;MSDN&lt;/a&gt;):
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.miky-schreiber.com/Blog/content/binary/NonEmptyBehavior.gif" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
This is the calculation expressions pane from the Calculations tab in the cube designer.
From MSDN:
&lt;/p&gt;
&lt;p&gt;
"&lt;span class=Apple-style-span style="WORD-SPACING: 0px; FONT: 16px 'Times New Roman'; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"&gt;&lt;span class=Apple-style-span style="FONT-SIZE: 11px; LINE-HEIGHT: 15px; FONT-FAMILY: Verdana"&gt;The
measures you specify in the&lt;span class=Apple-converted-space&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;Non-empty
behavior&lt;/strong&gt;&lt;span class=Apple-converted-space&gt;&amp;nbsp;&lt;/span&gt;list are used to resolve
NON EMPTY queries in MDX. When you specify one or more measures in the&lt;span class=Apple-converted-space&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;Non-empty
behavior&lt;/strong&gt;&lt;span class=Apple-converted-space&gt;&amp;nbsp;&lt;/span&gt;list, Analysis Services
treats the calculated member as empty if all the specified measures are empty. If
the&lt;span class=Apple-converted-space&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;Non-empty behavior&lt;/strong&gt;&lt;span class=Apple-converted-space&gt;&amp;nbsp;&lt;/span&gt;property
is blank, Analysis Services must evaluate the calculated member itself to determine
whether the member is empty.&lt;/span&gt;&lt;/span&gt;"
&lt;/p&gt;
&lt;p&gt;
This is not new. NEB is quite old feature in SSAS. The new thing (at least for me)
is that NEB can also be used in Panorama formulas! For example, M1+M2 /*NONEMPTY_BEHAVIOR={M1,M2}*/
will apply M1 &amp;amp; M2 as NEB. You can see more Panorama optimization methods &lt;a href="http://tech.panorama.com/index.php/category-table/367-a"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=d5f658b0-f87f-4975-ad06-f878d99b6301" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,d5f658b0-f87f-4975-ad06-f878d99b6301.aspx</comments>
      <category>BI;BI/MDX;BI/Panorama</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=6c28fd76-8c34-4ef0-8a42-ba2f267df8d3</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,6c28fd76-8c34-4ef0-8a42-ba2f267df8d3.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,6c28fd76-8c34-4ef0-8a42-ba2f267df8d3.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=6c28fd76-8c34-4ef0-8a42-ba2f267df8d3</wfw:commentRss>
      <title>History Browsing in OLAP and LastNonEmptyLeaf</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,6c28fd76-8c34-4ef0-8a42-ba2f267df8d3.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,6c28fd76-8c34-4ef0-8a42-ba2f267df8d3.aspx</link>
      <pubDate>Wed, 03 Mar 2010 12:34:48 GMT</pubDate>
      <description>&lt;img style="MARGIN: 0px 1em 1em" height="50%" src="http://www.miky-schreiber.com/Blog/content/binary/time.jpg" width="25%" align=left&gt; One
of the basic requirements of a modern BI system or Data Warehouse is to be non-volatile,
meaning that the DWH will save the history. In this post I'll explain how to implement
it in the DWH while assuming that the history can be changed and (the more interesting
part) how to implement it in Analysis Services.&lt;br&gt;
&lt;p&gt;
Before starting with history saving in the DWH,&amp;nbsp;I need to say that this has nothing
to do with Slowly Changing Dimensions. You can work with Type 1, 2 or 3. All you need
to take care of is that the fact table will be consistent with the dimension tables.
Assuming that the history can change (this is&amp;nbsp;the scenario&amp;nbsp;in my organization),
we need to extract all the fact data every time. If you work with staging level/environment/layer
you can use it to calculate which records has been changed or&amp;nbsp;inserted&amp;nbsp;and
only upsert them&amp;nbsp;to the DWH itself (it's more secure). In our case, we'll work
without such staging level so we need to load all the fact data in every load to the
DWH.
&lt;/p&gt;
&lt;p&gt;
Loading&amp;nbsp;the fact&amp;nbsp;in the ETL is very simple - we'll&amp;nbsp;save the&amp;nbsp;datetime
of the execution start, round it&amp;nbsp;and put it in every&amp;nbsp;row in the fact table.
We can call this field&amp;nbsp;CreateTime. You probably ask yourself why we need to round
it. The answer is that we don't want the time dimension to have every possible value
of datetime. It's huge and the users don't need that kind of accuracy. That's why
I round it in my projects to half-hour, meaning that 14:27 becomes 14:00 and 14:50
becomes 14:30. Let's look at an example of such fact table:
&lt;/p&gt;
&lt;p&gt;
&lt;table style="WIDTH: 389pt; BORDER-COLLAPSE: collapse" cellspacing=0 cellpadding=0 width=518 border=0 x:str&gt;
&lt;colgroup&gt;
&lt;col style="WIDTH: 50pt; mso-width-source: userset; mso-: 2450" width=67&gt;
&lt;col style="WIDTH: 63pt; mso-width-source: userset; mso-: 3072" span=2 width=84&gt;
&lt;col style="WIDTH: 53pt; mso-width-source: userset; mso-: 2560" span=2 width=70&gt;
&lt;col style="WIDTH: 107pt; mso-width-source: userset; mso: 5229" width=143&gt;
&lt;tbody&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl22 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 50pt; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-: transparent" width=67 height=17&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;RowNum&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl22 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 63pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=84&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Dimension1&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl22 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 63pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=84&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Dimension2&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl22 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 53pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=70&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Measure1&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt; P&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl22 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 53pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=70&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Measure2&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt; P&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl23 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 107pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=143&gt;
&lt;p align=center&gt;
&lt;strong&gt;&lt;em&gt;&lt;u&gt;&lt;font face=Arial color=#000000 size=2&gt;CreateTime&lt;/font&gt;&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17 x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;X&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;A&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;4&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;20&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;03/03/2010 15:00&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17 x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;2&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;X&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;B&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;56&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;strong&gt;&lt;font face=Arial color=#000000 size=2&gt;19&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;03/03/2010 15:00&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17 x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;3&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Y&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;B&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;2&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;3&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;03/03/2010 15:00&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17 x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;4&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Y&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;B&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;strong&gt;&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;10&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;03/03/2010 15:00&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17 x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;5&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Y&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;C&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;7&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;5&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;03/03/2010 15:00&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17 x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;6&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;X&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;A&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;4&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;20&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;03/03/2010 15:30&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17 x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;7&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;X&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;B&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;56&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;strong&gt;&lt;font face=Arial color=#000000 size=2&gt;40&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;03/03/2010 15:30&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17 x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;8&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Y&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;B&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;2&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;3&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;03/03/2010 15:30&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17 x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;9&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Y&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;B&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;strong&gt;&lt;font face=Arial color=#000000 size=2&gt;10&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;10&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;03/03/2010 15:30&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17 x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;10&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Y&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;C&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;7&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;5&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;03/03/2010 15:30&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/p&gt;
&lt;p&gt;
Here we can see two executions of the ETL: The first between 15:00 and 15:00, the
second between 15:31 and 15:59. Note the differences in rows 2 vs. 7 and 4 vs. 9.
This means that the source table(s) has changed between the executions.
&lt;/p&gt;
&lt;p&gt;
In the DWH, we create foreign keys from Dimension1 and Dimension2 to their dimension
tables. We'll also create FK between CreateTime and the time dimension. I won't get
into the time dimension design here, you can read about it&amp;nbsp;a &lt;a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,73f9d050-05bd-4dc9-b719-ae9d256557b3.aspx"&gt;past
post&lt;/a&gt;. I assume that the time dimension has the hierarchy Year -&amp;gt; Month -&amp;gt;
Day -&amp;gt; Hour -&amp;gt; Half-Hour. It seems that now we have a good fact table for use
in Reporting Services (or any other reporting tool). Create a parameter called Extraction
Time/ETL Time and assign it values from distinct on CreateTime. The user can pick
a date and the report will filter on this date. Perfect.
&lt;/p&gt;
&lt;p&gt;
The problematic part starts in Analysis Services. &lt;strong&gt;Only one extraction time
can be the current member. There is no sense in summing or aggregating more than one
extraction time.&lt;/strong&gt; There are two ways to deal with it:
&lt;/p&gt;
&lt;u&gt;The wrong way&lt;/u&gt; - I'm writing&amp;nbsp;this down so you'll learn from this &lt;em&gt;design
mistake&lt;/em&gt;. We created a calculated member which takes the last extraction time: 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Create Member CurrentCube.[Extraction Time]. [Calendar].[All].[Last Data Time]&lt;br&gt;
AS&lt;br&gt;
Tail ([Extraction Time].[Calendar].[HALF HOUR].Members,1).Item(0),&lt;br&gt;
Visible = 1; 
&lt;p&gt;
In every Panorama view, we sliced the Extraction time on the [Last Data Time] member,
which will show the user the data of the last ETL run. Our basic assumption was that
the user wants to see the current data and when he'll want to see the historical data
he will pick another member from the Extraction time dimension. This is the point
we missed and it soon&amp;nbsp; enough bumped into our face. 
&lt;p&gt;
We forgot that every system, even BI system which is built for analysts should be
intuitive and idiot-proof. The users picked members from the day level in the Extraction
time dimension. When we asked them why they did it they said that "we wanted to see
the data from 03/03/2010 and suddenly the numbers got bigger!". That happened, of
course, because the member 03/03/2010 is the sum of 03/03/2010 15:00 and 03/03/2010
15:30. The solution is that no matter which member the user picks in the Extraction
time dimension, he should see only one leaf (half-hour level) member at a time. This
takes us to 
&lt;p&gt;
&lt;u&gt;The right way&lt;/u&gt; - We set the [Last Data Time] member to be visible = 0 (I kept
it for debug purposes) and I written MDX script which I call NonLastEmptyLeaf. This
script makes sure that&amp;nbsp;no matter which member in the Extraction time hierarchy
will be picked, the user will be sliced only on the last non empty leaf. For example,
if the user picks 03/03/2010 he will see the data of 03/03/2010 15:30. This is what
will happen also when he'll slice on 03/2010, 2010 and even the [All] member. This
is the MDX script:&lt;br&gt;
&lt;br&gt;
Freeze([Extraction time].[Calendar].[All]);&lt;br&gt;
Scope(&lt;br&gt;
&amp;nbsp; Descendants (&lt;br&gt;
&amp;nbsp;&amp;nbsp; [Extraction time].[Calendar]. [All],&lt;br&gt;
&amp;nbsp;&amp;nbsp; 0,&lt;br&gt;
&amp;nbsp;&amp;nbsp; SELF_AND_AFTER&lt;br&gt;
&amp;nbsp; )&lt;br&gt;
);&lt;br&gt;
&amp;nbsp; this = Tail (&lt;br&gt;
&amp;nbsp;&amp;nbsp; Filter(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Descendants(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Extraction time]. [Calendar].CurrentMember,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Extraction time].[Calendar].[HALF HOUR],&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LEAVES&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [Measures].CurrentMember &amp;gt; 0&lt;br&gt;
&amp;nbsp;&amp;nbsp; ) 
&lt;br&gt;
&amp;nbsp; ).Item(0);&lt;br&gt;
End Scope;
&lt;/p&gt;
&lt;p&gt;
Now, there is no meaning of [Last Data Time] member because slicing on the [All] member
will show the current data, meaning that no slicing at all will show the current data
because [All] is the default member.
&lt;/p&gt;
&lt;p&gt;
To conclude,&amp;nbsp;history browsing can be dangerous if we let the users the option
to slice on more than one data time. The open question that I have is how can I prevent
the user from picking more than one member in this hierarchy in Panorama views? Should
I even try to do that or should I count on his minimal common sense?
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=6c28fd76-8c34-4ef0-8a42-ba2f267df8d3" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,6c28fd76-8c34-4ef0-8a42-ba2f267df8d3.aspx</comments>
      <category>BI;BI/DataWarehousing;BI/MDX;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=51a6ed33-2855-4d28-af43-6af5d6c8ecd6</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,51a6ed33-2855-4d28-af43-6af5d6c8ecd6.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,51a6ed33-2855-4d28-af43-6af5d6c8ecd6.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=51a6ed33-2855-4d28-af43-6af5d6c8ecd6</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <title>Text in OLAP Measures</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,51a6ed33-2855-4d28-af43-6af5d6c8ecd6.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,51a6ed33-2855-4d28-af43-6af5d6c8ecd6.aspx</link>
      <pubDate>Sun, 14 Feb 2010 12:49:00 GMT</pubDate>
      <description>&lt;p&gt;
I knew for a long time that measures can have text and not only numbers, but last
week I had a scenario where it was the perfect solution for my problem.
&lt;/p&gt;
&lt;p&gt;
Let's say that I work in number of jobs. In every job I got some tasks that I need
to do. The fact table looks like this:
&lt;/p&gt;
&lt;p&gt;
&lt;table style="WIDTH: 319pt; BORDER-COLLAPSE: collapse" cellspacing=0 cellpadding=0 width=425 border=0 x:str&gt;
&lt;colgroup&gt;
&lt;col style="WIDTH: 74pt; mso-width-source: userset; mso-width-alt: 3620" width=99&gt;
&lt;col style="WIDTH: 89pt; mso-width-source: userset; mso-width-alt: 4315" width=118&gt;
&lt;col style="WIDTH: 74pt; mso-width-source: userset; mso-width-alt: 3620" width=99&gt;
&lt;col style="WIDTH: 82pt; mso-width-source: userset; mso-width-alt: 3986" width=109&gt;
&lt;tbody&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl24 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; WIDTH: 74pt; BORDER-BOTTOM: #ece9d8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" width=99 height=17&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Job&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; WIDTH: 89pt; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" width=118&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Task&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; WIDTH: 74pt; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" width=99&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Tasks To Do&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl24 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; WIDTH: 82pt; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" width=109&gt;
&lt;p align=center&gt;
&lt;strong&gt;&lt;em&gt;&lt;u&gt;&lt;font face=Arial color=#000000 size=2&gt;Tasks Completed&lt;/font&gt;&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Developer&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Develop BI System&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Developer&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Help Friends&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Manager&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Manage&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;1&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="HEIGHT: 12.75pt" height=17&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;Therapist&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent"&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td class=xl25 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" x:num&gt;
&lt;p align=center&gt;
&lt;font face=Arial color=#000000 size=2&gt;0&lt;/font&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/p&gt;
&lt;p&gt;
Summarizing the "Tasks To Do" column will get the total tasks that I need to do. Summarizing
the "Tasks Completed" column will get the tasks that I did. Note that in the Therapist
job I didn't get any tasks.&lt;br&gt;
In the OLAP cube, I created a calculated measure which is the percent of the completed
tasks (for every job or for any other dimension). The&amp;nbsp;problem is: What is the
answer in case that there are no any tasks to do? Some will say 0% and some will say
100%. That's why a text measure such as "There are no tasks" can be a perfect solution
for this kind of problem. This is the calculation of the calculated measure:
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
Create Member CurrentCube.[Measures].[Completed Percentage] as&lt;br&gt;
IIF(IsEmpty([Measures].[Tasks To Do]),&lt;br&gt;
&amp;nbsp;&amp;nbsp;null,&lt;br&gt;
&amp;nbsp;&amp;nbsp;IIF([Measures].[Tasks To Do] = 0),&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'There are no tasks',&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Measures].[Completed Tasks] / [Measures].[Tasks To Do]&lt;br&gt;
&amp;nbsp;&amp;nbsp;)&lt;br&gt;
)&lt;br&gt;
This scenario can happen in many cubes. Tell me if you have any other solution for
this kind of problem.
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;u&gt;Update:&lt;/u&gt;&lt;/em&gt; Read the important comments below.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=51a6ed33-2855-4d28-af43-6af5d6c8ecd6" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,51a6ed33-2855-4d28-af43-6af5d6c8ecd6.aspx</comments>
      <category>BI;BI/MDX;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=5c9ebeb3-98d5-43ea-9f63-a0e18c3929bd</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,5c9ebeb3-98d5-43ea-9f63-a0e18c3929bd.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,5c9ebeb3-98d5-43ea-9f63-a0e18c3929bd.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=5c9ebeb3-98d5-43ea-9f63-a0e18c3929bd</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
After announcing the <a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,aca4f6ce-32bb-47ab-a453-5b23c25b3d48.aspx">MdxInjection
program</a> I got several requests for additional details and for the ability to run
it without using Visual Studio. So, here are some important points:
</p>
        <ul>
          <li>
When I published it I had developers in mind because I'm sure than anyone will want
to do his little modification before using it for his own needs. That's why I published
it as a solution and not as executable. 
</li>
          <li>
I written it down using VS2008 but only with the .Net 2 framework. Those of you who
uses VS2005 won't be able to open the solution. 
</li>
          <li>
The program has only one public method - InjectMdx, who takes two arguments: The location
of the CommonMdx file and the location of the xml configuration file. 
</li>
          <li>
The CommonMdx.mdx file contains the common MDX script. The relevant part has
to start with /* Common MDX */ and then the common mdx script. Anything written before
it won't be treated. That gives you the ability to save some data or comments for
yourself in this file. 
</li>
          <li>
Example of the configuration xml file can be found in the Test libary inside the solution.
Basically, it enable you to define in which servers, databases and cubes you want
to inject the common script. Pay attention that you have to write the connection strings
in this file. 
</li>
          <li>
Note that the program will detect cube dimensions with their name changed and will
know how to replace them. That means that if you mention the Time dimension in the
common script and inject it to AdventureWorks cube, the script will replace the string
"Time" with the "ShipmentDate" string, for example.</li>
        </ul>
        <p>
For those of you who want simple execution file, I added a windows console project
in the solution.
</p>
        <a href="http://www.miky-schreiber.com/blog/content/binary/MdxInjectionConsoleApp.zip">Link
to only executable program</a>
        <br />
        <a href="http://www.miky-schreiber.com/blog/content/binary/MdxInjection2.zip">Link
to the solution with the added windows application project</a>
        <br />
        <a href="http://www.miky-schreiber.com/blog/content/binary/MdxInjection.zip">Link
to the solution without the windows application project</a>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=5c9ebeb3-98d5-43ea-9f63-a0e18c3929bd" />
      </body>
      <title>The MdxInjection Program - continued</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,5c9ebeb3-98d5-43ea-9f63-a0e18c3929bd.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,5c9ebeb3-98d5-43ea-9f63-a0e18c3929bd.aspx</link>
      <pubDate>Mon, 17 Nov 2008 21:54:17 GMT</pubDate>
      <description>&lt;p&gt;
After announcing the &lt;a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,aca4f6ce-32bb-47ab-a453-5b23c25b3d48.aspx"&gt;MdxInjection
program&lt;/a&gt; I got several requests for additional details and for the ability to run
it without using Visual Studio. So, here are some important points:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
When I published it I had developers in mind because I'm sure than anyone will want
to do his little modification before using it for his own needs. That's why I published
it as a solution and not as executable. 
&lt;li&gt;
I written it down using VS2008 but only with the .Net 2 framework. Those of you who
uses VS2005 won't be able to open the solution. 
&lt;li&gt;
The program has only one public method - InjectMdx, who takes two arguments: The&amp;nbsp;location
of the CommonMdx file and the location of the xml configuration file. 
&lt;li&gt;
The CommonMdx.mdx file contains the common MDX script. The relevant part&amp;nbsp;has
to start with /* Common MDX */ and then the common mdx script. Anything written before
it won't be treated. That gives you the ability to save some data or comments for
yourself in this file. 
&lt;li&gt;
Example of the configuration xml file can be found in the Test libary inside the solution.
Basically, it enable you to define in which servers, databases and cubes you want
to inject the common script. Pay attention that you have to write the connection strings
in this file. 
&lt;li&gt;
Note that the program will detect cube dimensions with their name changed and will
know how to replace them. That means that if you mention the Time dimension in the
common script and inject it to AdventureWorks cube, the script will replace the&amp;nbsp;string
"Time"&amp;nbsp;with the "ShipmentDate" string, for example.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
For those of you who want simple execution file, I added a windows console project
in the solution.
&lt;/p&gt;
&lt;a href="http://www.miky-schreiber.com/blog/content/binary/MdxInjectionConsoleApp.zip"&gt;Link
to only executable program&lt;/a&gt;
&lt;br&gt;
&lt;a href="http://www.miky-schreiber.com/blog/content/binary/MdxInjection2.zip"&gt;Link
to the solution with the added windows application project&lt;/a&gt;
&lt;br&gt;
&lt;a href="http://www.miky-schreiber.com/blog/content/binary/MdxInjection.zip"&gt;Link
to the solution without the windows application project&lt;/a&gt;&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=5c9ebeb3-98d5-43ea-9f63-a0e18c3929bd" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,5c9ebeb3-98d5-43ea-9f63-a0e18c3929bd.aspx</comments>
      <category>BI;BI/MDX;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services;Programming;Programming/.Net</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=aca4f6ce-32bb-47ab-a453-5b23c25b3d48</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,aca4f6ce-32bb-47ab-a453-5b23c25b3d48.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,aca4f6ce-32bb-47ab-a453-5b23c25b3d48.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=aca4f6ce-32bb-47ab-a453-5b23c25b3d48</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In the <a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,f5f76417-9128-4fd7-a8d6-ba60619df30e.aspx">previous
post</a> I talked about the DRY principle in the BI Development. I mentioned that
one of the major problems in the principle's implementation is in the common MDX code. <a href="http://cwebbbi.spaces.live.com/">Chris</a> Commented:
</p>
        <p>
"I'd like to be able to have a global MDX Script and be able to do something like
a #include to bring calculations into specific cubes. One to add to my wishlist for
the next version..."
</p>
        <p>
And as I said there that I have a temporary good solution until we'll have
it in the next SQL Server release (if someone from Microsoft is reading...).
</p>
        <p>
The MdxInjection program takes your common MDX Script and a very simple xml file that
defines where to inject this script. It injects the script into your desired cubes
and even replaces the dimensions' names where necessary (it is relevant where you
put dimension in a cube with a different name to thr dimension or when you use Role
Playing Dimensions). I couldn't hold myself from writing some test code so it's also
included in the project. The project is written in C# 2 using much AMO code. All the
technical little details are inside.
</p>
        <p>
Enjoy.
</p>
        <p>
          <a href="http://www.miky-schreiber.com/blog/content/binary/MdxInjection.zip">Download
Link</a>
        </p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=aca4f6ce-32bb-47ab-a453-5b23c25b3d48" />
      </body>
      <title>The MdxInjection Program</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,aca4f6ce-32bb-47ab-a453-5b23c25b3d48.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,aca4f6ce-32bb-47ab-a453-5b23c25b3d48.aspx</link>
      <pubDate>Sun, 16 Nov 2008 23:29:02 GMT</pubDate>
      <description>&lt;p&gt;
In the &lt;a href="http://www.miky-schreiber.com/Blog/PermaLink,guid,f5f76417-9128-4fd7-a8d6-ba60619df30e.aspx"&gt;previous
post&lt;/a&gt; I talked about the DRY principle in the BI Development. I mentioned that
one of the major problems in the principle's implementation is in the common MDX code. &lt;a href="http://cwebbbi.spaces.live.com/"&gt;Chris&lt;/a&gt; Commented:
&lt;/p&gt;
&lt;p&gt;
"I'd like to be able to have a global MDX Script and be able to do something like
a #include to bring calculations into specific cubes. One to add to my wishlist for
the next version..."
&lt;/p&gt;
&lt;p&gt;
And as I said there&amp;nbsp;that&amp;nbsp;I have a temporary good solution until we'll have
it in the next SQL Server release (if someone from Microsoft is reading...).
&lt;/p&gt;
&lt;p&gt;
The MdxInjection program takes your common MDX Script and a very simple xml file that
defines where to inject this script. It injects the script into your desired cubes
and even replaces the dimensions' names where necessary (it is relevant where you
put dimension in a cube with a different name to thr dimension or when you use Role
Playing Dimensions). I couldn't hold myself from writing some test code so it's also
included in the project. The project is written in C# 2 using much AMO code. All the
technical little details are inside.
&lt;/p&gt;
&lt;p&gt;
Enjoy.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.miky-schreiber.com/blog/content/binary/MdxInjection.zip"&gt;Download
Link&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=aca4f6ce-32bb-47ab-a453-5b23c25b3d48" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,aca4f6ce-32bb-47ab-a453-5b23c25b3d48.aspx</comments>
      <category>BI;BI/MDX;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services;Programming;Programming/.Net</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=a53efa89-7232-4d27-b27e-0e3174beeaf0</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,a53efa89-7232-4d27-b27e-0e3174beeaf0.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,a53efa89-7232-4d27-b27e-0e3174beeaf0.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=a53efa89-7232-4d27-b27e-0e3174beeaf0</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <b>
          <i>
            <u>update:</u>
          </i>
        </b> Chris Webb
and Mosha commented and made it clear that the reason for this error wrap is the NonEmptyCrossJoin
function and nothing else. I also checked and I did not find any other function that
wraps underlying errors.<br /><br />
This is something you need to be aware of when you're writing MDX. I don't know whether
it's a bug or by-design. I'll be happy 
<br />
to know (please comment if you know something that I don't).<br />
Consider the following MDX:<br /><br /><span id="FormatMDX"><span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><span style="color: blue;">SELECT </span><br />
  <span style="color: blue;">NonEmptyCrossJoin</span><br />
  (<br />
    [Customer].[Customer Geography].[State-Province].&amp;[NSW]&amp;[AU].<span style="color: blue;">Children</span><br />
   ,[Employee].[Employee Department].[Department].&amp;[Sales]<br />
  ) ON 0<br /><span style="color: blue;">FROM </span>[Adventure Works];<br /><br /></span></span>The query will return with this error:<span id="FormatMDX"><span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> The
Set_Count argument of the NonEmptyCrossJoin function is either negative or larger
than the number of sets provided. </span></span>This is quite reasonable because I
written the second argument as a member, where (NonEmpty)CrossJoin expects only sets.
So, let's upgrade this member to a set:<br /><br /><span id="FormatMDX"><span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><span style="color: blue;">SELECT </span><br />
  <span style="color: blue;">NonEmptyCrossJoin</span><br />
  (<br />
    [Customer].[Customer Geography].[State-Province].&amp;[NSW]&amp;[AU].<span style="color: blue;">Children</span><br />
   ,{[Employee].[Employee Department].[Department].&amp;[Sales]}<br />
  ) ON 0<br /><span style="color: blue;">FROM </span>[Adventure Works];</span></span><br /><br />
All I did is wrapping the second argument with {} and we have a set. The query will
return 19 columns.<br />
Now, for the interesting part. Let's count the members of this CrossJoin before the
we fix it:<br /><br /><span id="FormatMDX"><span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><span style="color: blue;">WITH </span><br />
  <span style="color: blue;">MEMBER</span> [a] <span style="color: blue;">AS</span><br />
    <span style="color: blue;">NonEmptyCrossJoin</span><br />
    (<br />
      [Customer].[Customer Geography].[State-Province].&amp;[NSW]&amp;[AU].<span style="color: blue;">Children</span><br />
     ,[Employee].[Employee Department].[Department].&amp;[Sales]<br />
    ).<span style="color: blue;">Count</span><br /><span style="color: blue;">SELECT </span><br />
  [a] ON 0<br /><span style="color: blue;">FROM </span>[Adventure Works];</span></span><br /><br />
This return... 0.                <img src="http://www.miky-schreiber.com/Blog/content/binary/mdxZero.JPG" border="0" /><br /><b>Where is the error?</b><br />
My guess is that the Count function wraps the error. The NonEmptyCrossJoin returns
null and the count of members in null is zero. The meaning of this is that if you'll
ever forget to wrap the member with {} you'll always get zero and not an error. This
can be very dangerous. Just for the check, running this query after the fix:<br /><br /><span id="FormatMDX"><span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><span style="color: blue;">WITH </span><br />
  <span style="color: blue;">MEMBER</span> [a] <span style="color: blue;">AS</span><br />
    <span style="color: blue;">NonEmptyCrossJoin</span><br />
    (<br />
      [Customer].[Customer Geography].[State-Province].&amp;[NSW]&amp;[AU].<span style="color: blue;">Children</span><br />
     ,{[Employee].[Employee Department].[Department].&amp;[Sales]}<br />
    ).<span style="color: blue;">Count</span><br /><span style="color: blue;">SELECT </span><br />
  [a] ON 0<br /><span style="color: blue;">FROM </span>[Adventure Works];</span></span><br /><br />
will return 19. This been tested with both SSAS 2005 and 2008 (RC0). The examples
here are from RC0.<br /><br />
Be careful with your MDX.<br /><br /><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=a53efa89-7232-4d27-b27e-0e3174beeaf0" /></body>
      <title>Error Wrap in MDX</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,a53efa89-7232-4d27-b27e-0e3174beeaf0.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,a53efa89-7232-4d27-b27e-0e3174beeaf0.aspx</link>
      <pubDate>Sun, 03 Aug 2008 19:28:26 GMT</pubDate>
      <description>&lt;b&gt;&lt;i&gt;&lt;u&gt;update:&lt;/u&gt;&lt;/i&gt;&lt;/b&gt; Chris Webb and Mosha commented and made it clear that
the reason for this error wrap is the NonEmptyCrossJoin function and nothing else.
I also checked and I did not find any other function that wraps underlying errors.&lt;br&gt;
&lt;br&gt;
This is something you need to be aware of when you're writing MDX. I don't know whether
it's a bug or by-design. I'll be happy 
&lt;br&gt;
to know (please comment if you know something that I don't).&lt;br&gt;
Consider the following MDX:&lt;br&gt;
&lt;br&gt;
&lt;span id="FormatMDX"&gt;&lt;span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;NonEmptyCrossJoin&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Customer].[Customer Geography].[State-Province].&amp;amp;[NSW]&amp;amp;[AU].&lt;span style="color: blue;"&gt;Children&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;,[Employee].[Employee Department].[Department].&amp;amp;[Sales]&lt;br&gt;
&amp;nbsp;&amp;nbsp;) ON 0&lt;br&gt;
&lt;span style="color: blue;"&gt;FROM &lt;/span&gt;[Adventure Works];&lt;br&gt;
&lt;br&gt;
&lt;/span&gt;&lt;/span&gt;The query will return with this error:&lt;span id="FormatMDX"&gt;&lt;span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt; The
Set_Count argument of the NonEmptyCrossJoin function is either negative or larger
than the number of sets provided. &lt;/span&gt;&lt;/span&gt;This is quite reasonable because I
written the second argument as a member, where (NonEmpty)CrossJoin expects only sets.
So, let's upgrade this member to a set:&lt;br&gt;
&lt;br&gt;
&lt;span id="FormatMDX"&gt;&lt;span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;NonEmptyCrossJoin&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Customer].[Customer Geography].[State-Province].&amp;amp;[NSW]&amp;amp;[AU].&lt;span style="color: blue;"&gt;Children&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;,{[Employee].[Employee Department].[Department].&amp;amp;[Sales]}&lt;br&gt;
&amp;nbsp;&amp;nbsp;) ON 0&lt;br&gt;
&lt;span style="color: blue;"&gt;FROM &lt;/span&gt;[Adventure Works];&lt;/span&gt;&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
All I did is wrapping the second argument with {} and we have a set. The query will
return 19 columns.&lt;br&gt;
Now, for the interesting part. Let's count the members of this CrossJoin before the
we fix it:&lt;br&gt;
&lt;br&gt;
&lt;span id="FormatMDX"&gt;&lt;span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="color: blue;"&gt;WITH &lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;MEMBER&lt;/span&gt; [a] &lt;span style="color: blue;"&gt;AS&lt;/span&gt; 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;NonEmptyCrossJoin&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Customer].[Customer Geography].[State-Province].&amp;amp;[NSW]&amp;amp;[AU].&lt;span style="color: blue;"&gt;Children&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;,[Employee].[Employee Department].[Department].&amp;amp;[Sales]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;).&lt;span style="color: blue;"&gt;Count&lt;/span&gt; 
&lt;br&gt;
&lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;[a] ON 0&lt;br&gt;
&lt;span style="color: blue;"&gt;FROM &lt;/span&gt;[Adventure Works];&lt;/span&gt;&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
This return... 0.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;img src="http://www.miky-schreiber.com/Blog/content/binary/mdxZero.JPG" border="0"&gt;
&lt;br&gt;
&lt;b&gt;Where is the error?&lt;/b&gt;
&lt;br&gt;
My guess is that the Count function wraps the error. The NonEmptyCrossJoin returns
null and the count of members in null is zero. The meaning of this is that if you'll
ever forget to wrap the member with {} you'll always get zero and not an error. This
can be very dangerous. Just for the check, running this query after the fix:&lt;br&gt;
&lt;br&gt;
&lt;span id="FormatMDX"&gt;&lt;span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="color: blue;"&gt;WITH &lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;MEMBER&lt;/span&gt; [a] &lt;span style="color: blue;"&gt;AS&lt;/span&gt; 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;NonEmptyCrossJoin&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Customer].[Customer Geography].[State-Province].&amp;amp;[NSW]&amp;amp;[AU].&lt;span style="color: blue;"&gt;Children&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;,{[Employee].[Employee Department].[Department].&amp;amp;[Sales]}&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;).&lt;span style="color: blue;"&gt;Count&lt;/span&gt; 
&lt;br&gt;
&lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;[a] ON 0&lt;br&gt;
&lt;span style="color: blue;"&gt;FROM &lt;/span&gt;[Adventure Works];&lt;/span&gt;&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
will return 19. This been tested with both SSAS 2005 and 2008 (RC0). The examples
here are from RC0.&lt;br&gt;
&lt;br&gt;
Be careful with your MDX.&lt;br&gt;
&lt;br&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=a53efa89-7232-4d27-b27e-0e3174beeaf0" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,a53efa89-7232-4d27-b27e-0e3174beeaf0.aspx</comments>
      <category>BI;BI/MDX;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=c2148820-1e7d-47f2-bfea-ba50fdd639d1</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,c2148820-1e7d-47f2-bfea-ba50fdd639d1.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,c2148820-1e7d-47f2-bfea-ba50fdd639d1.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=c2148820-1e7d-47f2-bfea-ba50fdd639d1</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">I started a long <font color="#0000ff"><a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3197183&amp;SiteID=1">conversation</a></font> about
this subject in the <font color="#0000ff"><a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=83&amp;SiteID=1">MDSN
SSAS forum</a></font>. I think that it's a question and a principal that every advanced
MDX programmer should be familiar with.<br /><br />
It all started with a customer that needed a standard deviation aggregation. I thought
that it would be simple because there's a <a href="http://msdn.microsoft.com/en-us/library/ms146034.aspx">StdDev
function</a> in MDX, but it turned out that my customer had major plans for me: He
wanted this aggregation to act for every dimension he puts on his axis. This means
that the aggregation is not defined over a specific dimension (such as date), but
the std-dev is defined over the current dimension in the axis.<br /><br />
The solution for this problem consists of a principle and an answer.<br /><br /><u>The Principle<br /></u>Aggregation or a measure that is based on the current user's query is bad. This
can and will result two users to see different results using the same measure. This
will cause confusion and disinformation. The sacred principle of One Truth will be
desecrated. Taken from the thread, in <a href="http://cwebbbi.spaces.live.com">Chris
Webb</a>'s words:<br /><br />
"<i><span id="_ctl0_MainContent_PostFlatView"><span>I quite often see people wanting
to write calculations that behave differently depending on the query that's being
run, and I always tell them not to do it. You can hack something but it's almost impossible
to get it work properly for every single possible query - MDX just doesn't work like
that</span></span></i>"<br /><br />
In the end I explained that to the user and he agreed. One more reason for his approval
is that std-dev often doesn't really says something about the data. In other words,
it isn't informative. "The standard deviation is 0.432. That means that... ???"<br /><p></p><br /><u>The Answer</u><br />
If you (or the customer) still insists on that crazy measure, the following MDX will
work.<br /><br /><div><font face="Courier">With<br />
Member <font color="Blue">[</font>Measures<font color="Blue">]</font><font color="Blue">.</font><font color="Blue">[</font>RowSTDOrders<font color="Blue">]</font> <font color="Blue">as</font><br />
iif<font color="Blue">(</font>Count<font color="Blue">(</font>NonEmpty<font color="Blue">(</font>StrToSet<font color="Blue">(</font><font color="Maroon">"Axis(1)"</font><font color="Blue">)</font><font color="Blue">.</font>Item<font color="Blue">(</font><font color="Maroon">0</font><font color="Blue">)</font><font color="Blue">.</font>Hierarchy<font color="Blue">.</font>Children, 
<br /><font color="Blue">{</font><font color="Blue">[</font>Measures<font color="Blue">]</font><font color="Blue">.</font><font color="Blue">[</font>Order Quantity<font color="Blue">]</font><font color="Blue">}</font><font color="Blue">)</font> <font color="Blue">as</font> ChildSet<font color="Blue">)</font> &lt; <font color="Maroon">2</font>, 
<br />
Null, 
<br />
StDev<font color="Blue">(</font>ChildSet, <font color="Blue">[</font>Measures<font color="Blue">]</font><font color="Blue">.</font><font color="Blue">[</font>Order Quantity<font color="Blue">]</font><font color="Blue">)</font><font color="Blue">)<br /></font> <br />
select 
<br /><font color="Blue">[</font>Date<font color="Blue">]</font><font color="Blue">.</font><font color="Blue">[</font>Calendar Year<font color="Blue">]</font><font color="Blue">.</font><font color="Blue">[</font>Calendar Year<font color="Blue">]</font> on <font color="Maroon">0</font>, 
<br />
Non Empty <font color="Blue">[</font>Product<font color="Blue">]</font><font color="Blue">.</font><font color="Blue">[</font>Product Categories<font color="Blue">]</font><font color="Blue">.</font>Members on <font color="Maroon">1</font><br />
from <font color="Blue">[</font>Adventure Works<font color="Blue">]</font><br />
where <font color="Blue">[</font>Measures<font color="Blue">]</font><font color="Blue">.</font><font color="Blue">[</font>RowSTDOrders<font color="Blue">]<br /><br /></font></font>Thanks for Deepak Puri for this code. Notice that the StrToSet function
will cause performance degrade, but this is the only way that the code will also work
in MDX script and not only in queries.<br /><br />
P.S<br />
It doesn't matter if you write StDev or StdDev.<br /></div><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=c2148820-1e7d-47f2-bfea-ba50fdd639d1" /></body>
      <title>Very Customed Aggregation</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,c2148820-1e7d-47f2-bfea-ba50fdd639d1.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,c2148820-1e7d-47f2-bfea-ba50fdd639d1.aspx</link>
      <pubDate>Tue, 13 May 2008 20:28:38 GMT</pubDate>
      <description>I started a long &lt;font color="#0000ff"&gt;&lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3197183&amp;amp;SiteID=1"&gt;conversation&lt;/a&gt;&lt;/font&gt; about
this subject in the &lt;font color="#0000ff"&gt;&lt;a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=83&amp;amp;SiteID=1"&gt;MDSN
SSAS forum&lt;/a&gt;&lt;/font&gt;. I think that it's a question and a principal that every advanced
MDX programmer should be familiar with.&lt;br&gt;
&lt;br&gt;
It all started with a customer that needed a standard deviation aggregation. I thought
that it would be simple because there's a &lt;a href="http://msdn.microsoft.com/en-us/library/ms146034.aspx"&gt;StdDev
function&lt;/a&gt; in MDX, but it turned out that my customer had major plans for me: He
wanted this aggregation to act for every dimension he puts on his axis. This means
that the aggregation is not defined over a specific dimension (such as date), but
the std-dev is defined over the current dimension in the axis.&lt;br&gt;
&lt;br&gt;
The solution for this problem consists of a principle and an answer.&lt;br&gt;
&lt;br&gt;
&lt;u&gt;The Principle&lt;br&gt;
&lt;/u&gt;Aggregation or a measure that is based on the current user's query is bad. This
can and will result two users to see different results using the same measure. This
will cause confusion and disinformation. The sacred principle of One Truth will be
desecrated. Taken from the thread, in &lt;a href="http://cwebbbi.spaces.live.com"&gt;Chris
Webb&lt;/a&gt;'s words:&lt;br&gt;
&lt;br&gt;
"&lt;i&gt;&lt;span id="_ctl0_MainContent_PostFlatView"&gt;&lt;span&gt;I quite often see people wanting
to write calculations that behave differently depending on the query that's being
run, and I always tell them not to do it. You can hack something but it's almost impossible
to get it work properly for every single possible query - MDX just doesn't work like
that&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;"&lt;br&gt;
&lt;br&gt;
In the end I explained that to the user and he agreed. One more reason for his approval
is that std-dev often doesn't really says something about the data. In other words,
it isn't informative. "The standard deviation is 0.432. That means that... ???"&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;br&gt;
&lt;u&gt;The Answer&lt;/u&gt;
&lt;br&gt;
If you (or the customer) still insists on that crazy measure, the following MDX will
work.&lt;br&gt;
&lt;br&gt;
&lt;div&gt;&lt;font face="Courier"&gt;With&lt;br&gt;
Member&amp;nbsp;&lt;font color="Blue"&gt;[&lt;/font&gt;Measures&lt;font color="Blue"&gt;]&lt;/font&gt;&lt;font color="Blue"&gt;.&lt;/font&gt;&lt;font color="Blue"&gt;[&lt;/font&gt;RowSTDOrders&lt;font color="Blue"&gt;]&lt;/font&gt;&amp;nbsp;&lt;font color="Blue"&gt;as&lt;/font&gt; 
&lt;br&gt;
iif&lt;font color="Blue"&gt;(&lt;/font&gt;Count&lt;font color="Blue"&gt;(&lt;/font&gt;NonEmpty&lt;font color="Blue"&gt;(&lt;/font&gt;StrToSet&lt;font color="Blue"&gt;(&lt;/font&gt;&lt;font color="Maroon"&gt;"Axis(1)"&lt;/font&gt;&lt;font color="Blue"&gt;)&lt;/font&gt;&lt;font color="Blue"&gt;.&lt;/font&gt;Item&lt;font color="Blue"&gt;(&lt;/font&gt;&lt;font color="Maroon"&gt;0&lt;/font&gt;&lt;font color="Blue"&gt;)&lt;/font&gt;&lt;font color="Blue"&gt;.&lt;/font&gt;Hierarchy&lt;font color="Blue"&gt;.&lt;/font&gt;Children, 
&lt;br&gt;
&lt;font color="Blue"&gt;{&lt;/font&gt;&lt;font color="Blue"&gt;[&lt;/font&gt;Measures&lt;font color="Blue"&gt;]&lt;/font&gt;&lt;font color="Blue"&gt;.&lt;/font&gt;&lt;font color="Blue"&gt;[&lt;/font&gt;Order&amp;nbsp;Quantity&lt;font color="Blue"&gt;]&lt;/font&gt;&lt;font color="Blue"&gt;}&lt;/font&gt;&lt;font color="Blue"&gt;)&lt;/font&gt;&amp;nbsp;&lt;font color="Blue"&gt;as&lt;/font&gt;&amp;nbsp;ChildSet&lt;font color="Blue"&gt;)&lt;/font&gt;&amp;nbsp;&amp;lt;&amp;nbsp;&lt;font color="Maroon"&gt;2&lt;/font&gt;, 
&lt;br&gt;
Null, 
&lt;br&gt;
StDev&lt;font color="Blue"&gt;(&lt;/font&gt;ChildSet,&amp;nbsp;&lt;font color="Blue"&gt;[&lt;/font&gt;Measures&lt;font color="Blue"&gt;]&lt;/font&gt;&lt;font color="Blue"&gt;.&lt;/font&gt;&lt;font color="Blue"&gt;[&lt;/font&gt;Order&amp;nbsp;Quantity&lt;font color="Blue"&gt;]&lt;/font&gt;&lt;font color="Blue"&gt;)&lt;/font&gt;&lt;font color="Blue"&gt;)&lt;br&gt;
&lt;/font&gt;&amp;nbsp;&lt;br&gt;
select 
&lt;br&gt;
&lt;font color="Blue"&gt;[&lt;/font&gt;Date&lt;font color="Blue"&gt;]&lt;/font&gt;&lt;font color="Blue"&gt;.&lt;/font&gt;&lt;font color="Blue"&gt;[&lt;/font&gt;Calendar&amp;nbsp;Year&lt;font color="Blue"&gt;]&lt;/font&gt;&lt;font color="Blue"&gt;.&lt;/font&gt;&lt;font color="Blue"&gt;[&lt;/font&gt;Calendar&amp;nbsp;Year&lt;font color="Blue"&gt;]&lt;/font&gt;&amp;nbsp;on&amp;nbsp;&lt;font color="Maroon"&gt;0&lt;/font&gt;, 
&lt;br&gt;
Non&amp;nbsp;Empty&amp;nbsp;&lt;font color="Blue"&gt;[&lt;/font&gt;Product&lt;font color="Blue"&gt;]&lt;/font&gt;&lt;font color="Blue"&gt;.&lt;/font&gt;&lt;font color="Blue"&gt;[&lt;/font&gt;Product&amp;nbsp;Categories&lt;font color="Blue"&gt;]&lt;/font&gt;&lt;font color="Blue"&gt;.&lt;/font&gt;Members&amp;nbsp;on&amp;nbsp;&lt;font color="Maroon"&gt;1&lt;/font&gt; 
&lt;br&gt;
from&amp;nbsp;&lt;font color="Blue"&gt;[&lt;/font&gt;Adventure&amp;nbsp;Works&lt;font color="Blue"&gt;]&lt;/font&gt; 
&lt;br&gt;
where&amp;nbsp;&lt;font color="Blue"&gt;[&lt;/font&gt;Measures&lt;font color="Blue"&gt;]&lt;/font&gt;&lt;font color="Blue"&gt;.&lt;/font&gt;&lt;font color="Blue"&gt;[&lt;/font&gt;RowSTDOrders&lt;font color="Blue"&gt;]&lt;br&gt;
&lt;br&gt;
&lt;/font&gt;&lt;/font&gt;Thanks for Deepak Puri for this code. Notice that the StrToSet function
will cause performance degrade, but this is the only way that the code will also work
in MDX script and not only in queries.&lt;br&gt;
&lt;br&gt;
P.S&lt;br&gt;
It doesn't matter if you write StDev or StdDev.&lt;br&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=c2148820-1e7d-47f2-bfea-ba50fdd639d1" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,c2148820-1e7d-47f2-bfea-ba50fdd639d1.aspx</comments>
      <category>BI;BI/MDX;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=2efa7c5b-826e-43c4-af42-5608fdd6c188</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,2efa7c5b-826e-43c4-af42-5608fdd6c188.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,2efa7c5b-826e-43c4-af42-5608fdd6c188.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=2efa7c5b-826e-43c4-af42-5608fdd6c188</wfw:commentRss>
      <slash:comments>5</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I feel like I don't have the right to write about it after so many bits of information
were moving in the web about this subject but I would like to add my point of view
(or in fact - my point of code). First of all, I must mention some of those who written
about this subject before me. Mosha Pasumansky wrote a long <a href="http://sqljunkies.com/WebLog/mosha/archive/2007/05/22/current_date_mdx.aspx">post</a> about
it in last may. This post contains some ideas of how to come along with this problem,
but none of them is perfect. In fact (as always) - there is no perfect solution
for this problem. Another important source of knowledge can be found <a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=346119&amp;SiteID=1">here</a> in
the MSDN forums, where Chris Webb, Thomas Pagel and others discussed it. Now,
I would like to add my solution. Take it or leave it - your choice.
</p>
        <p>
First of all, create a column in the time dimension that will be the current day indicator.
Thanks to the Data Source View or the UDM approach of SSAS 2005 you don't have to
change the relational table itself. Just add a named calculation in the DSV with expression
that will be 1 for the row of the current day and null or zero for the others. The
expression syntax itself depends on the underlying DB so I won't write it here, but
it's very simple. Add this column as an attribute (let's call it CurrentDayInd) in
the dimension structure and select its AttributeVisible propertiey to false. That's
because we don't need such Attribute Hierarchy in our time dimension. After that,
create a new User Hierarchy (you can call it Current Day), where the first level in
it will be CurrentDayInd and after it place the day (key) attribute.
</p>
        <p>
Now, what we have here? We have a hierarchy (Current Day) with two members - 1 and
zero. The 1 member has only one child which is the current day. Link that member to
your regular hierarchy (it's called YSQMD at my place) and here you have it. For example,
you can use it that way in the MDX script:
</p>
        <p>
Create Set [Last 30 Days] as<br />
LinkMember([Time].[Current Day].[CurrentDayInd].&amp;[1].Children.Item(0),[Time].[YSQMD])<br />
:<br />
LinkMember([Time].[Current Day].[CurrentDayInd].&amp;[1].Children.Item(0),[Time].[YSQMD]).Lag(30);
</p>
        <p>
I think that this solution is good and elegant. First of all, you don't have to use
external functions such as Now(). The second pro is that we use the native OLAP mechanism
which saves time and makes the queries run faster. Believe me, you'll feel the difference
with big cubes. The last thing is that this solution is easy to understand (at least
I think so) and it is easy for maintenance. The big con is that you have to process
this dimension (and related cubes) every day. I don't think that it's so bad because
most of the organizations do make process every day.
</p>
        <p>
          <br />
 
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=2efa7c5b-826e-43c4-af42-5608fdd6c188" />
      </body>
      <title>Getting the Current Day in MDX</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,2efa7c5b-826e-43c4-af42-5608fdd6c188.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,2efa7c5b-826e-43c4-af42-5608fdd6c188.aspx</link>
      <pubDate>Tue, 08 Jan 2008 20:39:58 GMT</pubDate>
      <description>&lt;p&gt;
I feel like I don't have the right to write about it after so many bits of information
were moving in the web about this subject but I would like to add my point of view
(or in fact - my point of code). First of all, I must mention some of those who written
about this subject before me. Mosha Pasumansky wrote a long &lt;a href="http://sqljunkies.com/WebLog/mosha/archive/2007/05/22/current_date_mdx.aspx"&gt;post&lt;/a&gt; about
it in last may. This post contains some ideas of how to come along with this problem,
but none of them is perfect. In fact (as always) - there is no perfect&amp;nbsp;solution
for this problem. Another important source of knowledge can be found &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=346119&amp;amp;SiteID=1"&gt;here&lt;/a&gt; in
the MSDN forums, where Chris Webb, Thomas Pagel&amp;nbsp;and others discussed it. Now,
I would like to add my solution. Take it or leave it - your choice.
&lt;/p&gt;
&lt;p&gt;
First of all, create a column in the time dimension that will be the current day indicator.
Thanks to the Data Source View or the UDM approach of SSAS 2005 you don't have to
change the relational table itself. Just add a named calculation in the DSV with expression
that will be 1 for the row of the current day and null or zero for the others. The
expression syntax itself depends on the underlying DB so I won't write it here, but
it's very simple.&amp;nbsp;Add this column as an attribute (let's call it CurrentDayInd)&amp;nbsp;in
the dimension structure and select its AttributeVisible propertiey to false. That's
because we don't need such Attribute Hierarchy in our time dimension. After that,
create a new User Hierarchy (you can call it Current Day), where the&amp;nbsp;first level&amp;nbsp;in
it will be CurrentDayInd and after it place the day (key)&amp;nbsp;attribute.
&lt;/p&gt;
&lt;p&gt;
Now, what we have here? We have a hierarchy (Current Day) with two members - 1 and
zero. The 1 member has only one child which is the current day. Link that member to
your regular hierarchy (it's called YSQMD at my place) and here you have it. For example,
you can use it that way in the MDX script:
&lt;/p&gt;
&lt;p&gt;
Create Set [Last 30 Days] as&lt;br&gt;
LinkMember([Time].[Current Day].[CurrentDayInd].&amp;amp;[1].Children.Item(0),[Time].[YSQMD])&lt;br&gt;
:&lt;br&gt;
LinkMember([Time].[Current Day].[CurrentDayInd].&amp;amp;[1].Children.Item(0),[Time].[YSQMD]).Lag(30);
&lt;/p&gt;
&lt;p&gt;
I think that this solution is good and elegant. First of all, you don't have to use
external functions such as Now(). The second pro is that we use the native OLAP mechanism
which saves time and makes the queries run faster. Believe me, you'll feel the difference
with big cubes. The last thing is that this solution is easy to understand (at least
I think so) and it is easy for maintenance. The big con is that you have to process
this dimension (and related cubes) every day. I don't think that it's so bad because
most of the organizations do make process every day.
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=2efa7c5b-826e-43c4-af42-5608fdd6c188" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,2efa7c5b-826e-43c4-af42-5608fdd6c188.aspx</comments>
      <category>BI;BI/DataWarehousing;BI/MDX;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=a1c55658-cbf1-439d-88cc-d63ac1e2ba65</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,a1c55658-cbf1-439d-88cc-d63ac1e2ba65.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,a1c55658-cbf1-439d-88cc-d63ac1e2ba65.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=a1c55658-cbf1-439d-88cc-d63ac1e2ba65</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
As many of you already know, installation on Microsoft Excel on the SSAS 2005 server
is needed in order to use Excel functions in MDX. That's very helpful because MDX
is lack of many important functions such as Round (!). Many organizations don't like
it at all, but here's something that may help. In the SSAS 2005 server you don't need
to install the whole program, only the .Net programmability support. In the installation,
choose to manually pick up which components you wish to install and then
choose the .Net programmability Support as seen in the picture:
</p>
        <p>
          <img src="http://www.miky-schreiber.com/Blog/content/binary/excelProgSupport.GIF" border="0" />
        </p>
        <p>
Notice that this issue <a href="http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=124864">will
not be fixed in SSAS 2008</a>, so this tip will be relevant for a long time.
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=a1c55658-cbf1-439d-88cc-d63ac1e2ba65" />
      </body>
      <title>Excel in the SSAS 2005/8 Server</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,a1c55658-cbf1-439d-88cc-d63ac1e2ba65.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,a1c55658-cbf1-439d-88cc-d63ac1e2ba65.aspx</link>
      <pubDate>Mon, 31 Dec 2007 08:06:00 GMT</pubDate>
      <description>&lt;p&gt;
As many of you already know, installation on Microsoft Excel on the SSAS 2005&amp;nbsp;server
is needed in order to use Excel functions in MDX. That's very helpful because MDX
is lack of many important functions such as Round (!). Many organizations don't like
it at all, but here's something that may help. In the SSAS 2005 server you don't need
to install the whole program, only the .Net programmability support. In the installation,
choose to manually&amp;nbsp;pick up&amp;nbsp;which components you wish to install and then
choose the .Net programmability Support as seen in the picture:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.miky-schreiber.com/Blog/content/binary/excelProgSupport.GIF" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
Notice that this issue &lt;a href="http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=124864"&gt;will
not be fixed in SSAS 2008&lt;/a&gt;, so&amp;nbsp;this tip&amp;nbsp;will be relevant for a long time.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=a1c55658-cbf1-439d-88cc-d63ac1e2ba65" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,a1c55658-cbf1-439d-88cc-d63ac1e2ba65.aspx</comments>
      <category>BI;BI/MDX;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services;BI/SQL Server 2008;BI/SQL Server 2008/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=c4301bd6-b0d6-4f03-bbfe-f65e77ddb854</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,c4301bd6-b0d6-4f03-bbfe-f65e77ddb854.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,c4301bd6-b0d6-4f03-bbfe-f65e77ddb854.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=c4301bd6-b0d6-4f03-bbfe-f65e77ddb854</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
My team master Yaron asked me to check some things in the Panorama Dashboards:
</p>
1. Can have two hands in one gauge.<br />
2. Can I show two values in the text of every gauge. 
<p>
Here are the answers. I think that the second answer is a beautiful one. In fact,
I really enjoyed while I thought how to do this.
</p><p>
1. This is simple: Just use the Goal hand as the second hand. In the KPI Wizard go
to the Define Goal step and choose Custom formula. Enter the measure you want to see
in the second hand.
</p><p>
2. This is beautiful: In the KPI Wizard, go to the Finish step and to the Title part.
Click on the little blue arrow and click on "Edit MDX...". Then, write this MDX:
</p>
[My Dimension].[My Hierarchy].CurrentMember.Name + '\n' +<br />
[Measures].[First Measure].Name + ': ' +<br />
Generate({[My Dimension].[My Hierarchy].CurrentMember},[Measures].[First Measure])
+ '\n' +<br />
[Measures].[Second Measure].Name + ': ' +<br />
Generate({[My Dimension].[My Hierarchy].CurrentMember},[Measures].[Second Measure]) 
<p>
Note that:
</p><ul><li>
This solution may apply to other BI applications, not only to Panorama. 
</li><li>
This way you can show many values and data, not only two values. 
</li><li>
What the Generate function doing there? The '+' operator needs to have two strings
in both sides, so writing only the [Measures].[First Measure] or [Measures].[First
Measure].Value will return a numeric value which will cause error. The Generate function
used this way will return a string. It generates for the set (which contains only
our member) the value of the measure (in the second argument of the formula) and as
mentioned, returns it as string. 
</li><li>
'\n' will jump to the next line</li></ul><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=c4301bd6-b0d6-4f03-bbfe-f65e77ddb854" /></body>
      <title>Showing multiple values in Panorama Dashboards</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,c4301bd6-b0d6-4f03-bbfe-f65e77ddb854.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,c4301bd6-b0d6-4f03-bbfe-f65e77ddb854.aspx</link>
      <pubDate>Wed, 19 Dec 2007 19:18:35 GMT</pubDate>
      <description>&lt;p&gt;
My team master Yaron asked me to check some things in&amp;nbsp;the Panorama Dashboards:
&lt;/p&gt;
1.&amp;nbsp;Can have two hands in one gauge.&lt;br&gt;
2. Can I show two values in the text of every gauge. 
&lt;p&gt;
Here are the answers. I think that the second answer is a beautiful one. In fact,
I really enjoyed while&amp;nbsp;I thought how to do this.
&lt;/p&gt;
&lt;p&gt;
1. This is simple: Just use the Goal hand as the second hand. In the KPI Wizard go
to the Define Goal step and choose Custom formula. Enter the measure you want to see
in the second hand.
&lt;/p&gt;
&lt;p&gt;
2. This is beautiful: In the KPI Wizard, go to the Finish step and to the Title part.
Click on the little blue arrow and click on "Edit MDX...". Then, write this MDX:
&lt;/p&gt;
[My Dimension].[My Hierarchy].CurrentMember.Name + '\n' +&lt;br&gt;
[Measures].[First Measure].Name + ': ' +&lt;br&gt;
Generate({[My Dimension].[My Hierarchy].CurrentMember},[Measures].[First Measure])
+ '\n' +&lt;br&gt;
[Measures].[Second Measure].Name + ': ' +&lt;br&gt;
Generate({[My Dimension].[My Hierarchy].CurrentMember},[Measures].[Second Measure]) 
&lt;p&gt;
Note that:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
This solution may apply to other BI applications, not only to Panorama. 
&lt;li&gt;
This way you can show many values and data, not only two values. 
&lt;li&gt;
What the&amp;nbsp;Generate function doing there? The '+' operator needs to have two strings
in both sides, so writing only the [Measures].[First Measure] or [Measures].[First
Measure].Value will return a numeric value which will cause error. The Generate function
used this way will return a string. It generates for the set (which contains only
our member) the value of the measure (in the second argument of the formula) and as
mentioned, returns it as string. 
&lt;li&gt;
'\n' will jump to the next line&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=c4301bd6-b0d6-4f03-bbfe-f65e77ddb854" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,c4301bd6-b0d6-4f03-bbfe-f65e77ddb854.aspx</comments>
      <category>BI;BI/MDX;BI/Panorama</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=2781f9e8-ef93-45c8-b211-ad8c91c01315</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,2781f9e8-ef93-45c8-b211-ad8c91c01315.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,2781f9e8-ef93-45c8-b211-ad8c91c01315.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=2781f9e8-ef93-45c8-b211-ad8c91c01315</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I never thought of it until one of my users said it. Sorting the KPI can be a very
good idea. Instead of always having the same indicators (gauges, traffic lights, etc.)
in the same position of the screen, sorting it can make the viewer expect that
the most relevant indicator will be placed in the top-left corner of the screen, the
second most-relevant will be placed after it, etc.
</p>
        <p>
Sorting the KPI is a very easy thing. Every end user, even with no clue in MDX can
do it by following this:
</p>
        <p>
In the Define KPI wizard, go to the "Select Set" step. Copy the current set.
For the example, let's say that the current set is [Products].Members and you want
to sort it according to the Sales measure in descending order. Click on the advanced
button on the right of the set (The button with the "..." on it) and enter the following
MDX statement: 
</p>
        <p>
Order([Products].Members, [Measures].[Sales], DESC)
</p>
        <p>
If you want to order in ascending order you can replace the DESC with ASC or not to
mention it at all.
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=2781f9e8-ef93-45c8-b211-ad8c91c01315" />
      </body>
      <title>Sort your KPI</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,2781f9e8-ef93-45c8-b211-ad8c91c01315.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,2781f9e8-ef93-45c8-b211-ad8c91c01315.aspx</link>
      <pubDate>Wed, 21 Nov 2007 21:24:44 GMT</pubDate>
      <description>&lt;p&gt;
I never thought of it until one of my users said it. Sorting the KPI can be a very
good idea. Instead of always having the same indicators (gauges, traffic lights, etc.)
in the same position&amp;nbsp;of the screen, sorting it can make the viewer expect that
the most relevant indicator will be placed in the top-left corner of the screen, the
second most-relevant will be placed after it, etc.
&lt;/p&gt;
&lt;p&gt;
Sorting the KPI is a very easy thing. Every end user, even with no clue in MDX can
do it by following this:
&lt;/p&gt;
&lt;p&gt;
In the&amp;nbsp;Define KPI wizard, go to the "Select Set" step. Copy the current set.
For the example, let's say that the current set is [Products].Members and you want
to sort it according to the Sales measure in descending order. Click on the advanced
button on the right of the set (The button with the "..." on it) and enter the following
MDX statement: 
&lt;/p&gt;
&lt;p&gt;
Order([Products].Members, [Measures].[Sales], DESC)
&lt;/p&gt;
&lt;p&gt;
If you want to order in ascending order you can replace the DESC with ASC or not to
mention it at all.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=2781f9e8-ef93-45c8-b211-ad8c91c01315" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,2781f9e8-ef93-45c8-b211-ad8c91c01315.aspx</comments>
      <category>BI;BI/MDX;BI/Panorama</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=b183e49a-66e0-4390-a8d8-fdceac73b183</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,b183e49a-66e0-4390-a8d8-fdceac73b183.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,b183e49a-66e0-4390-a8d8-fdceac73b183.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=b183e49a-66e0-4390-a8d8-fdceac73b183</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I had a little challenge back in work and I solved it (in a couple of hours). Here
is the description of the problem and its solution:
</p>
        <p>
Let's say that I have a Products dimension, time dimension and a fact table that
describes all the faults which occurred in these products. The new requirement is
that: Given a product-tree that describes all the parts of every product, I want to
know how many faults occurred to every part. The problem is that the fact table points
only to the products and the customer wants to know how many faults happened to the
parts.
</p>
        <p>
The two solutions I thought about are:
</p>
        <p>
1. The trivial solution: Build a view above the fact table that takes every row and
adds a row for each of its product's parts. That way, the fact will contain every
fault that happened to every part. The problem with this solution is that the view
is very long to compute.
</p>
        <p>
2. The good solution: Build a parent-child dimension out of the parts table which
will describe all the parts of every product. Notice that this dimension is not ragged,
meaning that one member can have 2 children while another member in the same level
can have 10 children. The next step is to add this MDX Script:
</p>
        <p>
Calculate;
</p>
        <p>
          <br />
Scope([Measures].[Faults],<br />
         Descendants([Products].[Products].[All],<br />
                           1,<br />
                           After));
</p>
        <p>
          <br />
   This = Ancestor([Products].[Products].CurrentMember,<br />
                         [Products].[Products].[Level
02]);
</p>
        <p>
          <br />
End Scope;
</p>
        <p>
          <br />
Scope([Measures].[Faults],<br />
         [Products].[Products].[Level
02].Members);
</p>
        <p>
          <br />
   This = ([Products].[Products].CurrentMember)<br />
             -<br />
             Sum([Products].[Products].CurrentMember.Children);
</p>
        <p>
          <br />
End Scope;<br /></p>
        <p>
          <u>Explanation:</u> The first level of the dimension is the [All] member. The second
level is the products and the other levels contain the parts. The first block takes
all the parts and inherits their amount of faults from their product ancestor. The
second block solves the aggregation problem: Let's say that The bike product has 3
children. The bike had 4 faults in our slice of time, so according to the first
block of the script every child has 4 faults. Now, the cube makes its aggregation
and now the bikes has 16 faults - 4 of its own and more 4 for every of its parts.
The second block decreases the sum of the product's children from the products and
the result is that the products have their original number of faults.
</p>
        <img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=b183e49a-66e0-4390-a8d8-fdceac73b183" />
      </body>
      <title>Data Inheritence in MDX</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,b183e49a-66e0-4390-a8d8-fdceac73b183.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,b183e49a-66e0-4390-a8d8-fdceac73b183.aspx</link>
      <pubDate>Wed, 21 Nov 2007 20:12:21 GMT</pubDate>
      <description>&lt;p&gt;
I had a little challenge back in work and I solved it (in a couple of hours). Here
is the description of the problem and its solution:
&lt;/p&gt;
&lt;p&gt;
Let's say that I have a Products dimension, time dimension&amp;nbsp;and a fact table that
describes all the faults which occurred in these products. The new requirement is
that: Given a product-tree that describes all the parts of every product, I want to
know how many faults occurred to every part. The problem is that the fact table points
only to the products and the customer wants to know how many faults happened to the
parts.
&lt;/p&gt;
&lt;p&gt;
The two solutions I thought about are:
&lt;/p&gt;
&lt;p&gt;
1. The trivial solution: Build a view above the fact table that takes every row and
adds a row for each of its product's parts. That way, the fact will contain every
fault that happened to every part. The problem with this solution is that the view
is very long to compute.
&lt;/p&gt;
&lt;p&gt;
2. The good solution: Build a parent-child dimension out of the parts table which
will describe all the parts of every product. Notice that this dimension is not ragged,
meaning that one member can have 2 children while another member in the same level
can have 10 children. The next step is to add this MDX Script:
&lt;/p&gt;
&lt;p&gt;
Calculate;
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
Scope([Measures].[Faults],&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Descendants([Products].[Products].[All],&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;After));
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;This = Ancestor([Products].[Products].CurrentMember,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Products].[Products].[Level
02]);
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
End Scope;
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
Scope([Measures].[Faults],&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Products].[Products].[Level
02].Members);
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;This = ([Products].[Products].CurrentMember)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum([Products].[Products].CurrentMember.Children);
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
End Scope;&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;u&gt;Explanation:&lt;/u&gt; The first level of the dimension is the [All] member. The second
level is the products and the other levels contain the parts. The first block takes
all the parts and inherits their amount of faults from their product ancestor. The
second block solves the aggregation problem: Let's say that The bike product has 3
children. The bike had&amp;nbsp;4 faults in our slice of time, so according to the first
block of the script every child has 4 faults. Now, the cube makes its aggregation
and now the bikes has 16 faults - 4 of its own and more 4 for every of its parts.
The second block decreases the sum of the product's children from the products and
the result is that the products have their original number of faults.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=b183e49a-66e0-4390-a8d8-fdceac73b183" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,b183e49a-66e0-4390-a8d8-fdceac73b183.aspx</comments>
      <category>BI;BI/MDX</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=0ee6c819-dc0d-4801-a675-ceb967b17bb6</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,0ee6c819-dc0d-4801-a675-ceb967b17bb6.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,0ee6c819-dc0d-4801-a675-ceb967b17bb6.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=0ee6c819-dc0d-4801-a675-ceb967b17bb6</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">This post is about Panorama because it
is the UI tool I'm working with, but this can be made with every BI UI tool.<br /><br />
My customer wanted to get the effect shown by Analysis Services 2005 when browsing
a dimension (see the picture below). He wanted to see some properties of the members
shown in the rows, along with the usual measures. Unfortunately, Panorama (and I'm
sure that also other tools) does not have this option in the GIU. The solution is
this code:<br /><br />
Create Member CurrentCube.[Measures].[MyProperty] as<br />
  iif(IsLeaf([MyDimension].[MyHierarchy].CurrentMember),<br />
     [MyDimension].[MyHierarchy].CurrentMember.Properties("MyProperty"),<br />
     Null)<br /><br />
Note that declaring only the third row will cause that every member that is not a
leaf will cause an error, which is something we don't want the viewer to see. If the
dimension has properties for members in other levels too, you can adjust this decleration.
This member can be declared either in the DataBase's Script (after the CALCULATE expression)
or inside the session/query (not recommended in Panorama). Now, all you have to do
is to show the dimension's members in the rows and this new measure in the columns
(after or before the regular measures), and you'll get what you want.<br /><p></p><img src="http://www.miky-schreiber.com/Blog/content/binary/memberProperties.JPG" border="0" /><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=0ee6c819-dc0d-4801-a675-ceb967b17bb6" /></body>
      <title>Showing Member Properties in Panorama</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,0ee6c819-dc0d-4801-a675-ceb967b17bb6.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,0ee6c819-dc0d-4801-a675-ceb967b17bb6.aspx</link>
      <pubDate>Sun, 30 Sep 2007 18:47:12 GMT</pubDate>
      <description>This post is about Panorama because it is the UI tool I'm working with, but this can be made with every BI UI tool.&lt;br&gt;
&lt;br&gt;
My customer wanted to get the effect shown by Analysis Services 2005 when browsing
a dimension (see the picture below). He wanted to see some properties of the members
shown in the rows, along with the usual measures. Unfortunately, Panorama (and I'm
sure that also other tools) does not have this option in the GIU. The solution is
this code:&lt;br&gt;
&lt;br&gt;
Create Member CurrentCube.[Measures].[MyProperty] as&lt;br&gt;
&amp;nbsp; iif(IsLeaf([MyDimension].[MyHierarchy].CurrentMember),&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [MyDimension].[MyHierarchy].CurrentMember.Properties("MyProperty"),&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Null)&lt;br&gt;
&lt;br&gt;
Note that declaring only the third row will cause that every member that is not a
leaf will cause an error, which is something we don't want the viewer to see. If the
dimension has properties for members in other levels too, you can adjust this decleration.
This member can be declared either in the DataBase's Script (after the CALCULATE expression)
or inside the session/query (not recommended in Panorama). Now, all you have to do
is to show the dimension's members in the rows and this new measure in the columns
(after or before the regular measures), and you'll get what you want.&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img src="http://www.miky-schreiber.com/Blog/content/binary/memberProperties.JPG" border="0"&gt;&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=0ee6c819-dc0d-4801-a675-ceb967b17bb6" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,0ee6c819-dc0d-4801-a675-ceb967b17bb6.aspx</comments>
      <category>BI;BI/MDX;BI/Panorama;BI/SQL Server 2005;BI/SQL Server 2005/Analysis Services</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=05a1ad0f-445c-4069-bb29-1b91a871618d</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,05a1ad0f-445c-4069-bb29-1b91a871618d.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,05a1ad0f-445c-4069-bb29-1b91a871618d.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=05a1ad0f-445c-4069-bb29-1b91a871618d</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">I won't cover here the topic of Exception
handling in MDX, but show you a funny thing that I have never seen in any computer
language. Consider this MDX code:<br /><br />
iif (1.0e+40 * 1.0e+40 = (1/0), "Overflowed", "Didn't Overflow")*<br /><br />
On some processors, this code will output "Overflowed". That's because this multiplication
will overflow and (1/0) also overflows, so what we have here is two "overflow values"
that are equal. 
<br /><br />
Where on earth have you seen something like this???<span style="height: 10px; font-family: arial; font-size: 9pt; color: rgb(0, 0, 153);" dir="ltr" id="spnTrans2"></span><br /><br /><hr size="2" width="100%" />
* Taken from the book "MDX Solutions" second edition, p. 136<br /><br /><br /><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=05a1ad0f-445c-4069-bb29-1b91a871618d" /></body>
      <title>"Exception handling" in MDX</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,05a1ad0f-445c-4069-bb29-1b91a871618d.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,05a1ad0f-445c-4069-bb29-1b91a871618d.aspx</link>
      <pubDate>Sun, 09 Sep 2007 19:54:32 GMT</pubDate>
      <description>I won't cover here the topic of Exception handling in MDX, but show you a funny thing that I have never seen in any computer language. Consider this MDX code:&lt;br&gt;
&lt;br&gt;
iif (1.0e+40 * 1.0e+40 = (1/0), "Overflowed", "Didn't Overflow")*&lt;br&gt;
&lt;br&gt;
On some processors, this code will output "Overflowed". That's because this multiplication
will overflow and (1/0) also overflows, so what we have here is two "overflow values"
that are equal. 
&lt;br&gt;
&lt;br&gt;
Where on earth have you seen something like this???&lt;span style="height: 10px; font-family: arial; font-size: 9pt; color: rgb(0, 0, 153);" dir="ltr" id="spnTrans2"&gt;&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
&lt;hr size="2" width="100%"&gt;
* Taken from the book "MDX Solutions" second edition, p. 136&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=05a1ad0f-445c-4069-bb29-1b91a871618d" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,05a1ad0f-445c-4069-bb29-1b91a871618d.aspx</comments>
      <category>BI;BI/MDX</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=79822519-0f9f-4020-9504-d3c806281808</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,79822519-0f9f-4020-9504-d3c806281808.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,79822519-0f9f-4020-9504-d3c806281808.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=79822519-0f9f-4020-9504-d3c806281808</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">While reading the first chapter of the
book "<a href="http://www.amazon.com/MDX-Solutions-Microsoft-Analysis-Services/dp/0471748080">MDX
Solutions With MS SQL Server Analysis Services 2005 And Hyperion Essbase</a>", I wrote
down some important notes, especially for the MDX beginners. Even if you're experienced
user, check this out. You may find something useful.<br /><br /><ul><li>
If you were a code programmer in your past, you can relax: MDX don't care about capitalization.</li><li>
Don't even try to skip an axis: It's impossible and it is meaningless. Use the predefined
names for the axis, such as: columns, rows, pages, etc.</li><li>
You're new to MDX and the whole OLAP gives you a headache? Try to imagine this as
a <a href="http://en.wikipedia.org/wiki/Hypercube">hypercube</a>. It can help you
a lot.</li><li>
When writing large queries, pay attention to the "readability" of your MDX. Use the
Monospace fonts whenever possible.</li><li>
Do NOT think of SQL when learning or working with MDX. <span style="font-size: 12pt; line-height: 115%; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;">Although </span>the
syntaxes may look alike, these languages are totally different when you get to know
them.</li><li>
.Members will give you all regular members. .AllMembers will also include calculated
members.</li><li>
An expression like [Time].Members won't work if the Time dimension has multiple hierarchies.</li><li>
The asterisk (*) can replace the CrossJoin function. It may improve readability of
the code.</li><li>
When using Order() function, you can specify a sorting criteria which is not shown
in the result grid.<br /></li></ul><p></p><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=79822519-0f9f-4020-9504-d3c806281808" /></body>
      <title>MDX notes</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,79822519-0f9f-4020-9504-d3c806281808.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,79822519-0f9f-4020-9504-d3c806281808.aspx</link>
      <pubDate>Wed, 01 Aug 2007 17:04:47 GMT</pubDate>
      <description>While reading the first chapter of the book "&lt;a href="http://www.amazon.com/MDX-Solutions-Microsoft-Analysis-Services/dp/0471748080"&gt;MDX
Solutions With MS SQL Server Analysis Services 2005 And Hyperion Essbase&lt;/a&gt;", I wrote
down some important notes, especially for the MDX beginners. Even if you're experienced
user, check this out. You may find something useful.&lt;br&gt;
&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
If you were a code programmer in your past, you can relax: MDX don't care about capitalization.&lt;/li&gt;
&lt;li&gt;
Don't even try to skip an axis: It's impossible and it is meaningless. Use the predefined
names for the axis, such as: columns, rows, pages, etc.&lt;/li&gt;
&lt;li&gt;
You're new to MDX and the whole OLAP gives you a headache? Try to imagine this as
a &lt;a href="http://en.wikipedia.org/wiki/Hypercube"&gt;hypercube&lt;/a&gt;. It can help you
a lot.&lt;/li&gt;
&lt;li&gt;
When writing large queries, pay attention to the "readability" of your MDX. Use the
Monospace fonts whenever possible.&lt;/li&gt;
&lt;li&gt;
Do NOT think of SQL when learning or working with MDX. &lt;span style="font-size: 12pt; line-height: 115%; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Although &lt;/span&gt;the
syntaxes may look alike, these languages are totally different when you get to know
them.&lt;/li&gt;
&lt;li&gt;
.Members will give you all regular members. .AllMembers will also include calculated
members.&lt;/li&gt;
&lt;li&gt;
An expression like [Time].Members won't work if the Time dimension has multiple hierarchies.&lt;/li&gt;
&lt;li&gt;
The asterisk (*) can replace the CrossJoin function. It may improve readability of
the code.&lt;/li&gt;
&lt;li&gt;
When using Order() function, you can specify a sorting criteria which is not shown
in the result grid.&lt;br&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=79822519-0f9f-4020-9504-d3c806281808" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,79822519-0f9f-4020-9504-d3c806281808.aspx</comments>
      <category>BI;BI/MDX;Tips &amp; Tricks</category>
    </item>
    <item>
      <trackback:ping>http://www.miky-schreiber.com/Blog/Trackback.aspx?guid=4140afc4-7585-4eba-975a-f2fecf764ef7</trackback:ping>
      <pingback:server>http://www.miky-schreiber.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.miky-schreiber.com/Blog/PermaLink,guid,4140afc4-7585-4eba-975a-f2fecf764ef7.aspx</pingback:target>
      <dc:creator>mikypuff</dc:creator>
      <wfw:comment>http://www.miky-schreiber.com/Blog/CommentView,guid,4140afc4-7585-4eba-975a-f2fecf764ef7.aspx</wfw:comment>
      <wfw:commentRss>http://www.miky-schreiber.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=4140afc4-7585-4eba-975a-f2fecf764ef7</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">knowing the rules doesn't mean you know
how to play.<br />
A great <a href="http://www.panorama.com/blog/?p=55">post</a> in the <a href="http://www.panorama.com/blog/">Panorama
blog</a> with a riddle in MDX. No knowledge in MDX is required for this riddle, because
they teach you what you need to know to solve this riddle.<br />
Have fun. Believe me - you will.<br /><br /><u>Update:</u> Look at <a href="http://sqljunkies.com/WebLog/mosha/archive/2007/06/09/mdx_is_like_chess.aspx">Mosha
Pasumansky's blog</a> for another review at this MDX riddle. He claims that the answer
in Panorama's Blog is not complete. While I'm new to MDX, I understand that their
answer is not 100% complete, but I think it's enought in order to make their point.<br /><p></p><img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=4140afc4-7585-4eba-975a-f2fecf764ef7" /></body>
      <title>MDX is like chess</title>
      <guid isPermaLink="false">http://www.miky-schreiber.com/Blog/PermaLink,guid,4140afc4-7585-4eba-975a-f2fecf764ef7.aspx</guid>
      <link>http://www.miky-schreiber.com/Blog/PermaLink,guid,4140afc4-7585-4eba-975a-f2fecf764ef7.aspx</link>
      <pubDate>Sat, 02 Jun 2007 19:43:35 GMT</pubDate>
      <description>knowing the rules doesn't mean you know how to play.&lt;br&gt;
A great &lt;a href="http://www.panorama.com/blog/?p=55"&gt;post&lt;/a&gt; in the &lt;a href="http://www.panorama.com/blog/"&gt;Panorama
blog&lt;/a&gt; with a riddle in MDX. No knowledge in MDX is required for this riddle, because
they teach you what you need to know to solve this riddle.&lt;br&gt;
Have fun. Believe me - you will.&lt;br&gt;
&lt;br&gt;
&lt;u&gt;Update:&lt;/u&gt; Look at &lt;a href="http://sqljunkies.com/WebLog/mosha/archive/2007/06/09/mdx_is_like_chess.aspx"&gt;Mosha
Pasumansky's blog&lt;/a&gt; for another review at this MDX riddle. He claims that the answer
in Panorama's Blog is not complete. While I'm new to MDX, I understand that their
answer is not 100% complete, but I think it's enought in order to make their point.&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.miky-schreiber.com/Blog/aggbug.ashx?id=4140afc4-7585-4eba-975a-f2fecf764ef7" /&gt;</description>
      <comments>http://www.miky-schreiber.com/Blog/CommentView,guid,4140afc4-7585-4eba-975a-f2fecf764ef7.aspx</comments>
      <category>BI;BI/MDX</category>
    </item>
  </channel>
</rss>