<?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>Mark Mrachek - Business Intelligence Blog</title>
    <link>http://www.mrachek.com/</link>
    <description />
    <language>en-us</language>
    <copyright>Mark Mrachek</copyright>
    <lastBuildDate>Mon, 20 Feb 2006 02:21:11 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.8.5223.2</generator>
    <managingEditor>webmaster@mrachek.com</managingEditor>
    <webMaster>webmaster@mrachek.com</webMaster>
    <item>
      <trackback:ping>http://www.mrachek.com/Trackback.aspx?guid=8820cd3a-35f9-4c55-91b2-cc1dbd47fc83</trackback:ping>
      <pingback:server>http://www.mrachek.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.mrachek.com/PermaLink,guid,8820cd3a-35f9-4c55-91b2-cc1dbd47fc83.aspx</pingback:target>
      <dc:creator>webmaster@mrachek.com (Mark Mrachek)</dc:creator>
      <wfw:comment>http://www.mrachek.com/CommentView,guid,8820cd3a-35f9-4c55-91b2-cc1dbd47fc83.aspx</wfw:comment>
      <wfw:commentRss>http://www.mrachek.com/SyndicationService.asmx/GetEntryCommentsRss?guid=8820cd3a-35f9-4c55-91b2-cc1dbd47fc83</wfw:commentRss>
      <title>MDX NonEmpty() function vs NonEmptyCrossjoin() function in Analysis Services 2005</title>
      <guid>http://www.mrachek.com/PermaLink,guid,8820cd3a-35f9-4c55-91b2-cc1dbd47fc83.aspx</guid>
      <link>http://www.mrachek.com/PermaLink,guid,8820cd3a-35f9-4c55-91b2-cc1dbd47fc83.aspx</link>
      <pubDate>Mon, 20 Feb 2006 02:21:11 GMT</pubDate>
      <description>&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
   &lt;font color="#000000"&gt;If you have ever used the NonEmptyCrossjoin function, you may
   have been surprised (and frustrated) with the results your queries returned.&lt;span style=""&gt;&amp;nbsp; &lt;/span&gt;This
   function was added to Analysis Services 2000 to help with performance of queries,
   but it commonly returned incorrect results.&lt;span style=""&gt;&amp;nbsp; &lt;/span&gt;Fortunately
   the NonEmptyCrossjoin function is being deprecated.&lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
   &lt;o:p&gt;
      &lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;
   &lt;/o:p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
   &lt;font color="#000000"&gt;The NonEmpty() function is new in Analysis Services 2005 and
   should be used instead of the NonEmptyCrossjoin function.&lt;span style=""&gt;&amp;nbsp; &lt;/span&gt;The
   NonEmpty() function is powerful because it can be applied to MDX expressions whereas
   the NON EMPTY clause was only available at the top level in SELECT statements.&lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
   &lt;o:p&gt;
      &lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;
   &lt;/o:p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
   &lt;font color="#000000"&gt;This syntax for the NonEmpty() function is NonEmpty({set},[filter
   set])&lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
   &amp;nbsp;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
   I met with a developer and PM from the Analysis Services team last week in Redmond
   and they provided me with more information on the NonEmpty() function.&amp;nbsp; 
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
   &amp;nbsp;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
   If you use the NonEmpty() function without a filterset, then the expression is evaluated&amp;nbsp;using
   the default measure in your cube.&amp;nbsp; So, if you do not define a filterset and you
   did not specify a default measure in your cube, then you may get unexpected results
   with this function.&amp;nbsp; Because, even though you may not have explicity defined
   a default measure, all cubes have a default measure (Analysis Services will define
   a default measure even if you did not define one) and the NonEmpty() function will
   use this default measure as the context in which to evaluate the expression.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mrachek.com/aggbug.ashx?id=8820cd3a-35f9-4c55-91b2-cc1dbd47fc83" /&gt;</description>
      <comments>http://www.mrachek.com/CommentView,guid,8820cd3a-35f9-4c55-91b2-cc1dbd47fc83.aspx</comments>
      <category>Analysis Services/MDX</category>
    </item>
    <item>
      <trackback:ping>http://www.mrachek.com/Trackback.aspx?guid=03d2bee8-3288-4e5c-8793-a7bb47f2f073</trackback:ping>
      <pingback:server>http://www.mrachek.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.mrachek.com/PermaLink,guid,03d2bee8-3288-4e5c-8793-a7bb47f2f073.aspx</pingback:target>
      <dc:creator>webmaster@mrachek.com (Mark Mrachek)</dc:creator>
      <wfw:comment>http://www.mrachek.com/CommentView,guid,03d2bee8-3288-4e5c-8793-a7bb47f2f073.aspx</wfw:comment>
      <wfw:commentRss>http://www.mrachek.com/SyndicationService.asmx/GetEntryCommentsRss?guid=03d2bee8-3288-4e5c-8793-a7bb47f2f073</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <font face="Verdana" size="2">I’ve written thousands of lines of MDX code over the
   years to support web reporting applications and today I discovered something new. 
   Although it probably isn’t new to MDX, it was new to me because I never needed it
   until today.  I was targeting the ascendants of a member and based on the parent
   of the member, I needed to alter the slice of the cube.<br /><br />
   Typically, when I use conditional statements, I create calculated member and handle
   the logic in the WITH statement.  Today’s challenge was different because I was
   not able to control what calculated members are passed from Panorama to Analysis Services. 
   Instead, I needed to work through the ‘WHERE’ clause to slice my data.  <br /><br />
   Anyways, I don’t know if I’ll ever need to use it in the future, but it’s nice to
   know that this functionality exists.  Below is a sample MDX statement that uses
   a conditional statement in the ‘WHERE’ clause.  This sample provides little value
   except to illustrate that you can indeed use conditional statements in ‘WHERE’ clauses.<br /><br />
   SELECT [Measures].[Internet Total Product Cost] ON 0,<br />
   [Sales Reason].[Sales Reasons].Members ON 1<br />
   FROM [Adventure Works]<br />
   WHERE (IIF([Sales Territory].[Sales Territory].[Sales Territory Country].[Australia].Parent.Name
   = “Pacific”, [Sales Territory].[Sales Territory], [Sales Territory].[Sales Territory].[Sales
   Territory Country].[Australia]))<br /></font>
        <br />
        <img width="0" height="0" src="http://www.mrachek.com/aggbug.ashx?id=03d2bee8-3288-4e5c-8793-a7bb47f2f073" />
      </body>
      <title>Conditional Statements in the MDX WHERE Clause</title>
      <guid>http://www.mrachek.com/PermaLink,guid,03d2bee8-3288-4e5c-8793-a7bb47f2f073.aspx</guid>
      <link>http://www.mrachek.com/PermaLink,guid,03d2bee8-3288-4e5c-8793-a7bb47f2f073.aspx</link>
      <pubDate>Thu, 26 Jan 2006 06:46:50 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;font face=Verdana size=2&gt;I’ve written thousands of lines of MDX code over the years
to support web reporting applications and today I discovered something new.&amp;nbsp;
Although it probably isn’t new to MDX, it was new to me because I never needed it
until today.&amp;nbsp; I was targeting the ascendants of a member and based on the parent
of the member, I needed to alter the slice of the cube.&lt;br&gt;
&lt;br&gt;
Typically, when I use conditional statements, I create calculated member and handle
the logic in the WITH statement.&amp;nbsp; Today’s challenge was different because I was
not able to control what calculated members are passed from Panorama to Analysis Services.&amp;nbsp;
Instead, I needed to work through the ‘WHERE’ clause to slice my data. &amp;nbsp;&lt;br&gt;
&lt;br&gt;
Anyways, I don’t know if I’ll ever need to use it in the future, but it’s nice to
know that this functionality exists.&amp;nbsp; Below is a sample MDX statement that uses
a conditional statement in the ‘WHERE’ clause.&amp;nbsp; This sample provides little value
except to illustrate that you can indeed use conditional statements in ‘WHERE’ clauses.&lt;br&gt;
&lt;br&gt;
SELECT [Measures].[Internet Total Product Cost] ON 0,&lt;br&gt;
[Sales Reason].[Sales Reasons].Members ON 1&lt;br&gt;
FROM [Adventure Works]&lt;br&gt;
WHERE (IIF([Sales Territory].[Sales Territory].[Sales Territory Country].[Australia].Parent.Name
= “Pacific”, [Sales Territory].[Sales Territory], [Sales Territory].[Sales Territory].[Sales
Territory Country].[Australia]))&lt;br&gt;
&lt;/font&gt;
&lt;br&gt;
&lt;img width="0" height="0" src="http://www.mrachek.com/aggbug.ashx?id=03d2bee8-3288-4e5c-8793-a7bb47f2f073" /&gt;</description>
      <comments>http://www.mrachek.com/CommentView,guid,03d2bee8-3288-4e5c-8793-a7bb47f2f073.aspx</comments>
      <category>Analysis Services;Analysis Services/MDX</category>
    </item>
  </channel>
</rss>