<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Data Inspirations</title>
	<atom:link href="http://blog.datainspirations.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.datainspirations.com</link>
	<description>Inspiring Intelligence from Information</description>
	<lastBuildDate>Mon, 07 May 2012 19:51:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Always Have an Exit Strategy&#8230;or Lesson(s) Learned at SQLBits X</title>
		<link>http://blog.datainspirations.com/2012/04/04/always-have-an-exit-strategy-or-lessons-learned-at-sqlbits-x/</link>
		<comments>http://blog.datainspirations.com/2012/04/04/always-have-an-exit-strategy-or-lessons-learned-at-sqlbits-x/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 16:35:22 +0000</pubDate>
		<dc:creator>Stacia Misner</dc:creator>
				<category><![CDATA[Conference]]></category>
		<category><![CDATA[SQLBits]]></category>

		<guid isPermaLink="false">http://blog.datainspirations.com/?p=744</guid>
		<description><![CDATA[I&#8217;ll never look the same way at a water closet again. (For the uninitiated, a water closet is a stall in a restroom, toilet, lavatory&#8230;you get the idea.) Before I close the door, I will check to make sure that I have an exit strategy. This was perhaps the most important lesson I learned at [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://commons.wikipedia.org/wiki/File:Fire_exit.svg" target="_blank"><img class="zemanta-img-inserted zemanta-img-configured alignright" title="Emergency exit sign used in the European Union..." src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/ab/Fire_exit.svg/300px-Fire_exit.svg.png" alt="Emergency exit sign used in the European Union..." width="75" height="43" /></a>I&#8217;ll never look the same way at a water closet again. (For the uninitiated, a water closet is a stall in a restroom, toilet, lavatory&#8230;you get the idea.) Before I close the door, I will check to make sure that I have an exit strategy. This was perhaps the most important lesson I learned at <a href="http://sqlbits.com" target="_blank">SQLBits X</a> in London last week. Actually, I never saw an Exit sign anywhere in London &#8211; only a sign with the symbol shown in the illustration at right or a sign indicating the Way Out, but having a Way Out strategy doesn&#8217;t sound right to my American ears.</p>
<p>Each night of the conference, many of the speakers and attendees gathered in the lobby of the Novotel London West, the venue for the conference. At one point, late in the evening (or perhaps early in the morning), I stepped away to &#8220;powder my nose,&#8221; and probably didn&#8217;t mention it to anyone either. Usually, one doesn&#8217;t need to register one&#8217;s destination for that sort of activity. It&#8217;s not like going for a hike alone in a national forest. So off I went, but when I tried to leave my water closet, the door handle broke off in my hand and I was unable to unlock the door and make my exit.</p>
<p>It&#8217;s important for my American readers to understand why this was a problem. The water closet doors are constructed to leave only an inch or two at the bottom and at the top of the stall door and floor-to-ceiling walls on three sides. There was no way to climb or crawl out.</p>
<p>I&#8217;m a handy sort of person and could have used a screwdriver to pry open the door (I think), but I had no purse with me. Which wouldn&#8217;t have contained a screwdriver even if I did have it, but perhaps something else in my purse would have proven helpful. Nor did I have my phone with me so that I could phone, text, or tweet about my dilemma. I thought, &#8220;What would <a href="http://en.wikipedia.org/wiki/MacGyver" target="_blank">MacGyver</a> do?&#8221;</p>
<p>I tried yelling, but no one could hear me. I was in a part of the hotel that few would be walking past. Furthermore, most of the people speaking at or attending SQLBits are men, so I could not count on someone coming to rescue me soon. Fortunately, the story ends well. After about 10 minutes, I heard someone walk in and I said, &#8220;I know this sounds weird, but I&#8217;m trapped in here, and I was hoping you could open the door from that side.&#8221; Silence. And then my door opened! Carmel &#8211; Bob Duffy&#8217;s (<a href="http://blogs.prodata.ie/" target="_blank">blog</a> | <a href="http://twitter.com/bob_duffy" target="_blank">twitter</a>) wife &#8211; was my heroine!</p>
<p>Fortunately, the door locking mechanism had a handle on the outside that was still attached and functional. I don&#8217;t know what would have happened otherwise. Dismantle the door from the hinges? Chainsaw? I&#8217;ll never know. But I will not close a stall door ever again without first checking to make sure that I can get out again.</p>
<h2>Other Lessons Learned</h2>
<p>Of course, that experience was not the only lesson learned, but it was the most humorous. I knew many of the organizers at SQLBits from my involvement in the SQL community for years, and met others that I had previously only known by name. I learned they really know how to put on an excellent show and I appreciate all the hard work they did to make this a great event. If you ever get a chance to go, please do &#8211; you will not regret it.</p>
<p>I was privileged and honored to be accepted as a speaker for a pre-conference session, &#8220;<a href="http://sqlbits.com/information/Event10/A_360-Degree_View_of_SQL_Server_2012_Business_Intelligence1/TrainingDetails.aspx" target="_blank">A 360-Degree View of SQL Server 2012 Business Intelligence</a>&#8221; and for two other sessions. One was &#8220;<a href="http://sqlbits.com/Sessions/Event10/_Way_Too_Much_Fun_with_Reporting_Services" target="_blank">(Way Too Much) Fun with Reporting Services</a>&#8221; which I co-presented with my daughter Erika Bakse (<a href="http://erikasblog.datainspirations.com/" target="_blank">blog</a> | <a href="http://twitter.com/BakseDoesBI" target="_blank">twitter</a>) and the other was &#8220;<a href="http://sqlbits.com/Sessions/Event10/So_How_Does_BI_Workload_Impact_the_Database_Engine_Part_I" target="_blank">So How Does the BI Workload Impact the Database Engine Part I</a>&#8221; which I co-presented with Denny Cherry (<a href="http://mrdenny.com" target="_blank">blog</a> | <a href="http://twitter.com/mrdenny" target="_blank">twitter</a>). Erika and I had a lot of fun showing some &#8220;out there&#8221; techniques with Reporting Services and will soon be sharing the solution and inviting the community to send suggestions for evolving the solution with more features. Denny and I also enjoyed the reprise of the first half of our PASS Summit 2011 session where we bring BI and DBA subject matter together. These sessions were recorded and will be available on the SQLBits site soon.</p>
<p>What lesson was there in these sessions for me? Words with Friends is not as popular in the UK as it is in the US (at least not with the SQLBits attendees) and that I can always tell my slides from Denny&#8217;s slides in a deck because mine have pictures. But he really knows his stuff and can riff at length about database performance issues. Not a surprise there, really &#8211; after all, he&#8217;s a <a href="http://www.microsoft.com/learning/en/us/certification/master.aspx" target="_blank">Microsoft Certified Master</a>.</p>
<h2>London Lessons</h2>
<p>I added some days before and after the conference to do some sightseeing and learned that London is a very easy town to explore. Once you get a ticket for the Underground, also known as the tube. Everything we wanted to see and do was a short walk from an Underground station in Zones 1 and 2.</p>
<p>Highlights of our tour of London &#8211; an absolute treasure trove for a history junkie like me:</p>
<table border="0" cellpadding="10">
<tbody>
<tr>
<td><a href="http://blog.datainspirations.com/wp-content/uploads/2012/04/HDQ.jpg"><img class="alignleft size-medium wp-image-752" title="The Hung Drawn and Quartered" src="http://blog.datainspirations.com/wp-content/uploads/2012/04/HDQ-300x199.jpg" alt="" width="300" height="199" /></a></td>
<td>Erika and I had lunch with Denny and his wife Kris at our first English Pub, in view of the Tower of London and appropriately titled The Hung Drawn and Quartered.</td>
</tr>
<tr>
<td><a href="http://www.hrp.org.uk/TowerOfLondon/" target="_blank">Tower of London</a>, where Denny, Kris, Erika and I saw the Crown Jewels, Traitor&#8217;s Gate through which prisoners were brought for incarceration (and eventual execution in most cases), and walked through a medieval palace once inhabited by <a href="http://en.wikipedia.org/wiki/King_Edward_I" target="_blank">King Edward I</a> (1239-1307).</td>
<td><a href="http://blog.datainspirations.com/wp-content/uploads/2012/04/tower_of_london.jpg"><img class="alignleft size-medium wp-image-753" title="Tower of London" src="http://blog.datainspirations.com/wp-content/uploads/2012/04/tower_of_london-300x284.jpg" alt="" width="300" height="284" /></a></td>
</tr>
<tr>
<td> <a href="http://blog.datainspirations.com/wp-content/uploads/2012/04/SQLFamilyLondon.jpg"><img class="alignleft size-medium wp-image-754" title="SQLFamily in London" src="http://blog.datainspirations.com/wp-content/uploads/2012/04/SQLFamilyLondon-199x300.jpg" alt="" width="199" height="300" /></a></td>
<td>Lunch at <a href="http://en.wikipedia.org/wiki/Ye_Olde_Cheshire_Cheese" target="_blank">Ye Olde Cheshire Cheese</a> where Charles Dickens had his favorite seat (where Lara is seated). Pictured from left to right: Kris (Denny&#8217;s wife), Erika Bakse, Jennifer Moser, Jen Stirrup, Lara Rubbelke, Buck Woody, Denny Cherry&#8217;s forehead, and Chris Webb.</td>
</tr>
<tr>
<td>Jen Stirrup took us to see <a href="http://en.wikipedia.org/wiki/Big_ben" target="_blank">Big Ben</a> and the Houses of Parliament along the River Thames.</td>
<td> <a href="http://blog.datainspirations.com/wp-content/uploads/2012/04/BigBen.jpg"><img class="alignleft size-medium wp-image-758" title="BigBen" src="http://blog.datainspirations.com/wp-content/uploads/2012/04/BigBen-199x300.jpg" alt="" width="199" height="300" /></a></td>
</tr>
<tr>
<td><a href="http://blog.datainspirations.com/wp-content/uploads/2012/04/WestminsterAbbey1.jpg"><img class="alignleft size-medium wp-image-759" title="WestminsterAbbey" src="http://blog.datainspirations.com/wp-content/uploads/2012/04/WestminsterAbbey1-300x199.jpg" alt="" width="300" height="199" /></a></td>
<td>Nearby we saw <a href="http://en.wikipedia.org/wiki/Westminster_abbey" target="_blank">Westminster Abbey</a>, so we went in for a tour. It has a very rich history, and is the site of two coronations in 1066: <a href="http://en.wikipedia.org/wiki/Harold_Godwinson" target="_blank">King Harold</a>, the last Anglo-Saxon king in England, and <a href="http://en.wikipedia.org/wiki/William_the_Conqueror" target="_blank">William the Conqueror</a>, the first Norman king. Many royal weddings have occurred here, and many members of royal and noble families and other notable persons are buried here.</td>
</tr>
<tr>
<td>After the conference, Bill Graziano, Erika and I went to the <a href="http://www.britishmuseum.org/" target="_blank">British Museum</a>, where we explored items from Egypt, including the Rosetta Stone, and from Assyria, Greece, Rome, and Britain. We only scratched the surface of the museum&#8217;s contents.</td>
<td> <a href="http://blog.datainspirations.com/wp-content/uploads/2012/04/RosettaStone.jpg"><img class="alignleft size-medium wp-image-756" title="RosettaStone" src="http://blog.datainspirations.com/wp-content/uploads/2012/04/RosettaStone-199x300.jpg" alt="" width="199" height="300" /></a></td>
</tr>
<tr>
<td><a href="http://blog.datainspirations.com/wp-content/uploads/2012/04/Globe.jpg"><img class="alignleft size-medium wp-image-755" title="Globe" src="http://blog.datainspirations.com/wp-content/uploads/2012/04/Globe-300x199.jpg" alt="" width="300" height="199" /></a></td>
<td>And Erika and I wrapped up our time in London with a visit to the reconstruction of Shakespeare&#8217;s <a href="http://www.shakespearesglobe.com/exhibition" target="_blank">Globe Theatre</a>.</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blog.datainspirations.com/2012/04/04/always-have-an-exit-strategy-or-lessons-learned-at-sqlbits-x/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>SQL Azure Reporting Webinar on March 22: What, Why, How?</title>
		<link>http://blog.datainspirations.com/2012/03/16/sql-azure-reporting-webinar-on-march-22-what-why-how/</link>
		<comments>http://blog.datainspirations.com/2012/03/16/sql-azure-reporting-webinar-on-march-22-what-why-how/#comments</comments>
		<pubDate>Fri, 16 Mar 2012 16:44:05 +0000</pubDate>
		<dc:creator>Stacia Misner</dc:creator>
				<category><![CDATA[Reporting Services]]></category>
		<category><![CDATA[SQL Azure Reporting]]></category>

		<guid isPermaLink="false">http://blog.datainspirations.com/?p=739</guid>
		<description><![CDATA[Microsoft SQL Azure Reporting is a component of the Windows Azure Platform that brings SQL Server Reporting Services capabilities to the cloud. In my upcoming webinar, I’ll explain what cloud-based reporting is all about and the types of scenarios for which it makes sense. For example, although cloud-based reporting can be an attractive option for small-to-mid-sized [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>Microsoft SQL Azure Reporting is a component of the Windows Azure Platform that brings SQL Server Reporting Services capabilities to the cloud. In my <a href="http://www.syncfusion.com/downloads/resources/webinar/sql-azure?utm_medium=March16newsletter&amp;utm_source=WebinarSqlAzureReporting">upcoming webinar</a>, I’ll explain what cloud-based reporting is all about and the types of scenarios for which it makes sense. For example, although cloud-based reporting can be an attractive option for small-to-mid-sized businesses, there are also some compelling reasons why larger organizations might consider moving some reporting functions to the cloud.</p>
</div>
<p>SQL Azure Reporting is still in community preview mode, which means it is still evolving as a product, but that also means it is available for you to explore and evaluate at no additional charge. However, you will need a SQL Azure account, which provides you with cloud-based storage for your databases with or without a Windows Azure account. (With Windows Azure, you can host your own custom applications or run virtual machines in the cloud.) In my webinar, I’m going to show you how easy it is to set up your first SQL Azure database and to add SQL Azure Reporting. Currently, Microsoft is offering a <a href="http://www.windowsazure.com/en-us/pricing/free-trial/" target="_blank">three-month trial</a>, which includes a 1 GB edition of a SQL Azure database, so you can try it for yourself after watching my demonstration.</p>
<p>SQL Azure Reporting does not match SQL Server Reporting Services feature for feature, but it does provide a solid platform that is perfect for certain reporting scenarios. During the webinar, I’ll show you exactly what SQL Azure Reporting can do for you, and I’ll point out its limitations. That way, you can make an informed decision about using it to deliver business intelligence from the cloud.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.datainspirations.com/2012/03/16/sql-azure-reporting-webinar-on-march-22-what-why-how/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automate MDX Query Testing</title>
		<link>http://blog.datainspirations.com/2012/02/23/automate-mdx-query-testing/</link>
		<comments>http://blog.datainspirations.com/2012/02/23/automate-mdx-query-testing/#comments</comments>
		<pubDate>Thu, 23 Feb 2012 00:25:13 +0000</pubDate>
		<dc:creator>Stacia Misner</dc:creator>
				<category><![CDATA[Analysis Services]]></category>
		<category><![CDATA[MDX]]></category>

		<guid isPermaLink="false">http://blog.datainspirations.com/?p=731</guid>
		<description><![CDATA[In one my recent MDX classes, a student asked about automation of MDX queries for the purposes of testing query performance, so today I&#8217;ll answer that question and draw your attention to a few resources available. Get the ASCMD Utility If you&#8217;re running SQL Server 2008 Analysis Services or SQL Server 2008 R2 Analysis Services, [...]]]></description>
			<content:encoded><![CDATA[<p>In one my recent MDX classes, a student asked about automation of MDX queries for the purposes of testing query performance, so today I&#8217;ll answer that question and draw your attention to a few resources available.</p>
<h2>Get the ASCMD Utility</h2>
<p>If you&#8217;re running SQL Server 2008 Analysis Services or SQL Server 2008 R2 Analysis Services, you can download  the ASCMD_StressTestingScripts from the <a href="http://sqlsrvanalysissrvcs.codeplex.com/releases/view/22769" target="_blank">Analysis Services Samples page on Codeplex</a> to get the main prize, the compiled ASCMD executable. (This version should also work with SQL Server 2005 Analysis Services, but I haven&#8217;t tested it.)</p>
<p>This utility allows you to execute MDX or DMX queries or XMLA commands from the command line. This capability means that you can build out some complex batch files to automate your MDX query testing, along with other repetitive tasks such as database processing. You can view the <a href="http://msdn.microsoft.com/en-us/library/ms365187(SQL.90).aspx" target="_blank">2005 version of the ReadMe file</a> to see the syntax as well as various ways that you might you use this utility (if you scroll all the way to the bottom of the page).</p>
<p>The old ReadMe file doesn&#8217;t include all of the arguments that are in the latest version of ASCMD. You can <a href="http://www.google.com/url?sa=t&amp;rct=j&amp;q=ascmd%20randomseed&amp;source=web&amp;cd=3&amp;ved=0CCoQFjAC&amp;url=https%3A%2F%2Fmsftasprodsamples.svn.codeplex.com%2Fsvn%2FKatmai_Trunk%2FAdministrator%2Fascmd%2FReadme_ascmd.docx&amp;ei=KHZFT9XOIujMiQLbqb3ODg&amp;usg=AFQjCNEVpLicq2Dt76xaQBvKNsN1jxaUEw&amp;sig2=JzHyruuSDuhfc2JyWJYriQ" target="_blank">download a more current ReadMe document</a> that&#8217;s buried deep in the bowels of Codeplex to get more information.</p>
<h2>Try a Simple Command</h2>
<p>In theory, the stress testing scripts let you execute ASCMD as a single client with single query or multiple queries, or as multiple clients with single query, or as multiple clients with multiple queries.  I wasn’t able to get that piece working as a file seems to be missing from the download, but you can create your own batch files to do similar things. You can get the basic idea by reviewing the RunASCMDParallelStressTest.cmd and RunASCMDSerialStressTest.cmd files that come in the download.</p>
<p>If you don’t want to wade through all that batch file stuff to figure out how to make ASCMD work, let me cut to the chase. You can execute asmcd /? to see the parameters available. For running an MDX query, assuming that you want to capture trace information to see the query duration and key trace events like QuerySubcubeVerbose and GetDataFromCache, you use the following syntax:</p>
<pre> ascmd –S &lt;server\instance&gt; -d &lt;database name&gt; -I &lt;mdx file&gt; -o Output.xml -T &lt;CSV file&gt;</pre>
<p>So, for example, to run on my local instance, using a query file found in the Queries subfolder of the download, I would run the following command:</p>
<pre>ascmd -S localhost -d "Adventure Works DW 2008R2" -i Queries\Query1-3.mdx
-o Output.xml -T Trace.csv</pre>
<p>The Output.xml will contain the query results and a lot of metadata about the cube that you can probably ignore if your goal is to get performance testing data. The Trace file is a pipe-delimited CSV file that contains the same type of trace data that you get when you run a SQL Server Profiler trace for Analysis Services. The trace file gets overwritten on each execution, except as noted below.</p>
<p>You can adjust the level of detail in your trace file by adding the –Tl argument with one of the following values</p>
<ul>
<li><em>High</em> (default) – captures everything.</li>
<li><em>Medium</em> – captures everything except ProgressReportCurrent and Notification events.</li>
<li><em>Low</em> – captures only events with &#8220;End&#8221; or &#8220;Error&#8221;.</li>
<li><em>Duration</em> – captures only execution duration and writes one line in the trace file with current time, duration, execution text, database, and server name. If you use this argument, and execute ASCMD multiple times, each execution appends new data to the file.</li>
<li><em>Duration-result</em> – captures the same results as when you use &#8220;duration&#8221; but includes an addition column to store the result of the execution. Each execution appends new data to the file.</li>
</ul>
<h2>Batch It</h2>
<p>The ASCMD utility can run one file at a time, but you can put multiple queries into the file using a GO command between the queries. Or you can set up a batch process with a loop to call ASCMD multiple times.</p>
<p>You can leave out the –o argument but you’ll get the output stream on your screen, unless of course you put this into a batch file and use echo off and echo on after executing the ASCMD.</p>
<p>For performance testing, you should also include some additional steps before you run the MDX query to get true baseline performance measurements. Put these steps into an MDX or XMLA script file and use ASCMD to execute them in your batch file before running the MDX query that you&#8217;re testing:</p>
<ul>
<li>Clear the Analysis Services cache</li>
</ul>
<div>
<pre>&lt;Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine"&gt;
  &lt;ClearCache&gt;
    &lt;Object&gt;
      &lt;DatabaseID&gt;Adventure Works DW 2008R2&lt;/DatabaseID&gt;
    &lt;/Object&gt;
  &lt;/ClearCache&gt;
 &lt;/Batch&gt;</pre>
</div>
<ul>
<li><a href="http://asstoredprocedures.codeplex.com/wikipage?title=FileSystemCache" target="_blank">Clear the file system cache</a>.</li>
<li>Execute the MDX script independently.</li>
</ul>
<pre>SELECT {} ON 0 FROM [Adventure Works]</pre>
<h2>Learn More About Query Performance Analysis</h2>
<p>Now that you&#8217;ve captured trace event information, what do you do with it? Here are some resources to help you determine what it means:</p>
<ul>
<li><a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=661" target="_blank">Identifying and Resolving MDX Query Performance Bottlenecks</a></li>
<li><a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=3be0488d-e7aa-4078-a050-ae39912d2e43&amp;displaylang=en" target="_blank">Analysis Services 2008 Performance Guide</a></li>
</ul>
<h2> Updates</h2>
<p>I <a href=" http://sqlblog.com/blogs/stacia_misner " target="_blank">mirror my blog</a> and received a few comments at <a href="http://www.sqlblog.com" target="_blank">SQLBlog.com</a> about other tools for automating MDX query testing that I want to share here:</p>
<ul>
<li>Boyan Penev (<a href="http://twitter.com/boyanpenev" target="_blank">twitter</a> | <a href="http://www.bp-msbi.com/" target="_blank">blog</a>) reminded me that you can also use the <a href="http://asstoredprocedures.codeplex.com/wikipage?title=FileSystemCache" target="_blank">ClearAllCaches()</a> method to clear both SSAS cache and the file system cache.</li>
<li>Davide Mauri (<a href="http://twitter.com/mauridb" target="_blank">twitter</a> | <a href="http://sqlblog.com/blogs/davide_mauri/" target="_blank">blog</a>) recommends <a href="http://biquality.codeplex.com/" target="_blank">BI.Quality</a> for verifying that MDX results match expectations (and more!).</li>
<li>Jason Thomas (<a href="http://twitter.com/de_unparagoned" target="_blank">twitter</a> | <a href="http://road-blogs.blogspot.com/" target="_blank">blog</a>) uses <a href="http://asperfwb.codeplex.com/" target="_blank">AS Performance Workbench</a> for load testing MDX queries.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.datainspirations.com/2012/02/23/automate-mdx-query-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3 Big Changes in Analysis Services 2012 Enabling Flexible Design</title>
		<link>http://blog.datainspirations.com/2012/02/11/3-big-changes-in-analysis-services-2012-enabling-flexible-design/</link>
		<comments>http://blog.datainspirations.com/2012/02/11/3-big-changes-in-analysis-services-2012-enabling-flexible-design/#comments</comments>
		<pubDate>Sat, 11 Feb 2012 01:15:59 +0000</pubDate>
		<dc:creator>Stacia Misner</dc:creator>
				<category><![CDATA[Analysis Services]]></category>
		<category><![CDATA[BISM]]></category>
		<category><![CDATA[PowerPivot]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[SQL Server 2012]]></category>
		<category><![CDATA[Tabular]]></category>

		<guid isPermaLink="false">http://blog.datainspirations.com/?p=713</guid>
		<description><![CDATA[The upcoming release of SQL Server 2012 has a lot of new features for business intelligence developers to love. The free preview of Introducing Microsoft SQL Server 2012 (Microsoft Press, 2012) does not include the chapter on Analysis Services, but you’ll be able to read the details when the final version of the ebook is [...]]]></description>
			<content:encoded><![CDATA[<p>The upcoming release of SQL Server 2012 has a lot of new features for business intelligence developers to love. The free preview of <a href="http://blogs.msdn.com/b/microsoft_press/archive/2012/01/20/release-schedule-for-our-free-introducing-microsoft-sql-server-2012-ebook.aspx" target="_blank">Introducing Microsoft SQL Server 2012 (Microsoft Press, 2012)</a> does not include the chapter on Analysis Services, but you’ll be able to read the details when the final version of the ebook is released for download in March.</p>
<p>Overall, there are <a href="http://msdn.microsoft.com/en-us/library/bb522628(SQL.110).aspx" target="_blank">a lot of changes in Analysis Services 2012</a>, and it’s easy to get overwhelmed by the details. So, just as I did for <a title="8 Enhancements in Integration Services 2012 for Easier Package Development" href="http://blog.datainspirations.com/2012/01/27/8-enhancements-in-integration-services-2012-for-easier-package-development/">Integration Services 2012</a> last month, I thought about the key aspects of this release that I would single out as important:</p>
<ul>
<li>Business Intelligence Semantic Model</li>
<li>Tabular mode</li>
<li>Installation experience of PowerPivot for SharePoint</li>
</ul>
<h2><strong>Business Intelligence Semantic Model (BISM)</strong></h2>
<p>Back in Analysis Services 2005, the Unified Dimensional Model (UDM) made its debut.  The UDM was supposed to blur the lines between relational and multidimensional modeling. How well it accomplished that goal could be argued, but I’m not going to take sides on that issue because now it no longer matters. Why? Because BISM replaces UDM and very definitely addresses two styles of modeling: multidimensional and tabular (about which I explain more below).  To get the background, see Microsoft&#8217;s <a href="http://blogs.msdn.com/b/analysisservices/archive/2011/05/16/analysis-services-vision-amp-roadmap-update.aspx" target="_blank">vision and roadmap statement</a> describing the benefits at a high level.</p>
<p>Just as many people didn’t really understand that their development in Analysis Services (versions 2005, 2008, or 2008 R2) produced a UDM, they also don’t need to understand that their development in Analysis Services 2012 produces a BISM. Cubes from prior version will upgrade automatically when migrated to Analysis Services 2012.  It still stays multidimensional, and there is no magic button to convert it to tabular.</p>
<p>Lack of a magic button is not that big of a deal. I can’t think of a good reason to convert from multidimensional to tabular in most cases. However, I have heard through the grapevine of some scenarios where queries performed significantly faster against a tabular model as compared to a comparable design in a multidimensional model. It’s probably too early to say whether these performance improvements resulted from an anomaly or a genuine benefit of the VertiPaq engine that the tabular model uses.  For now, I would say the only way to know is to test it yourself with your own data. To do this, you will have to build the tabular model from scratch (unless some clever developer comes up with a tool to do the conversion some day).</p>
<h2><strong>Tabular Mode</strong></h2>
<p>When you install Analysis Sevices, you must choose from one of three server modes: Multidimensional mode (the one we’ve had since Analysis Services 2005), Tabular mode, and PowerPivot for SharePoint mode. They differ in the way they store data, how they use memory, and the engine they use to retrieve data for queries. Tabular mode uses the same VertiPaq Engine as PowerPivot for SharePoint mode, but as a separate instance and without the same dependency on SharePoint.</p>
<p>You can only store <a href="http://msdn.microsoft.com/en-us/library/hh212945(SQL.110).aspx">tabular models</a> on a server running a tabular mode instance. If you have ever built a PowerPivot model, you will find that building tabular models is strikingly similar. The difference is that you use SQL Server Data Tools (SSDT), the SQL Server 2012 replacement for Business Intelligence Development Studio that runs as a Visual Studio 2010 shell.</p>
<p>With tabular models, you can go beyond using relational sources to populate the model, using any of the sources that PowerPivot supports:  relational databases, Analysis Services cubes (any mode), Reporting Services reports (as a data feed), Azure DataMarket datasets, ATOM data feeds, Excel files, or text files. This flexibility can significantly speed up development time, and enables you to rationalize development of one-off or limited life-span tabular models, which might not happen if you were limited to multidimensional mode.</p>
<p>Some shortcomings of the tabular model that originated in PowerPivot have been overcome in this release. The following design features are now available in both PowerPivot and tabular models:</p>
<ul>
<li>Hierarchical structures, including parent-child hierarchies</li>
<li>Perspectives</li>
<li>Key performance indicators</li>
<li><del>Aggregations</del></li>
<li>Diagram interface for working with tables and relationships</li>
</ul>
<p>One advantage that tabular models have over PowerPivot models is the ability to <a href="http://msdn.microsoft.com/en-us/library/hh230976(SQL.110).aspx" target="_blank">partition</a> the data. You can then manage reprocessing of individual partitions manually within SSDT or using scripts that you execute on the tabular mode server.</p>
<p>Another advantage with tabular models is the ability to use <a href="http://msdn.microsoft.com/en-us/library/hh213165(SQL.110).aspx" target="_blank">role-based security</a> to control what people can see and do. At minimum, you set one role with permissions to allow read access and another role to administer the database. You can optionally create a role to allow users to both query and process the database, or restrict users only to processing. Another aspect of security that you might implement is <a href="http://msdn.microsoft.com/en-us/library/hh213165(SQL.110).aspx" target="_blank">row-level filtering</a>. For example, you might set up a role that can view only Bikes as a category, but you can also completely block a role from viewing any rows from a particular table.</p>
<p>A third distinctive feature of tabular mode is its <a href="http://msdn.microsoft.com/en-us/library/hh230898(SQL.110).aspx" target="_blank">DirectQuery mode</a>. You use this mode when you need to retrieve current data (rather than use the cache that tabular mode creates by default) from the source or when you want to query data volumes that are too large to hold in memory. You can use DirectQuery only when using SQL Server 2005 (or later) data. There are some additional <a href="http://msdn.microsoft.com/en-us/library/hh213006(SQL.110).aspx" target="_blank">limitations with formulas</a>, security, and client tool support that you should understand before choosing this option.</p>
<p>Use the following links to download tabular samples and follow a tutorial:</p>
<ul>
<li><a href="http://msftdbprodsamples.codeplex.com/releases/view/55330">http://msftdbprodsamples.codeplex.com/releases/view/55330</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/hh231691(SQL.110).aspx">http://msdn.microsoft.com/en-us/library/hh231691(SQL.110).aspx</a></li>
</ul>
<div>Use these links to follow blogs that discuss BISM and tabular topics:</div>
<div>
<ul>
<li>Chris Webb (<a href="http://twitter.com/technitrain" target="_blank">@technitrain</a>)</li>
<ul>
<li><a href="http://cwebbbi.wordpress.com/category/bism/">http://cwebbbi.wordpress.com/category/bism/</a></li>
<li><a href="http://cwebbbi.wordpress.com/category/tabular/">http://cwebbbi.wordpress.com/category/tabular/</a></li>
</ul>
<li>Marco Russo (<a href="http://twitter.com/marcorus" target="_blank">@marcorus</a>)</li>
<ul>
<li><a href="http://sqlblog.com/blogs/marco_russo/archive/tags/BISM/default.aspx">http://sqlblog.com/blogs/marco_russo/archive/tags/BISM/default.aspx</a></li>
<li><a href="http://sqlblog.com/blogs/marco_russo/archive/tags/Tabular/default.aspx">http://sqlblog.com/blogs/marco_russo/archive/tags/Tabular/default.aspx</a></li>
</ul>
</ul>
</div>
<h2><strong>PowerPivot for SharePoint Installation Experience</strong></h2>
<p>Installation and configuration of SQL Server 2008 R2 PowerPivot for SharePoint and SharePoint Server 2010 can be a bit challenging. Curiously, my post on <a href="http://blog.datainspirations.com/2010/05/23/installing-powerpivot-for-sharepoint-on-windows-7/" target="_blank">performing these steps on a Windows 7 machine</a> is one of the most popular posts on my blog. It was challenging due to the dependencies on the SharePoint farm, but the new release provides a <a href="http://msdn.microsoft.com/en-us/library/ee210609(v=sql.110).aspx" target="_blank">configuration wizard</a> that greatly simplifies and automates the process. You are not required to use it, but it’s a terrific option if you’re not well-versed in SharePoint administration. If you prefer to use PowerShell, there are <a href="http://msdn.microsoft.com/en-us/library/hh213341(SQL.110).aspx" target="_blank">SharePoint and PowerPivot PowerShell cmdlets</a> that you can use instead.</p>
<h2> Virtual Event Coming Soon!</h2>
<p>And if possible, make some time to learn more at the <a href="http://www.sqlserverlaunch.com/ww/Home" target="_blank">SQL Server 2012 Virtual Launch</a> on March 7th.</p>
<p>What features are you really looking forward to trying out?</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.datainspirations.com/2012/02/11/3-big-changes-in-analysis-services-2012-enabling-flexible-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>8 Enhancements in Integration Services 2012 for Easier Package Development</title>
		<link>http://blog.datainspirations.com/2012/01/27/8-enhancements-in-integration-services-2012-for-easier-package-development/</link>
		<comments>http://blog.datainspirations.com/2012/01/27/8-enhancements-in-integration-services-2012-for-easier-package-development/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 17:40:43 +0000</pubDate>
		<dc:creator>Stacia Misner</dc:creator>
				<category><![CDATA[Integration Services]]></category>
		<category><![CDATA[SQL Server 2012]]></category>
		<category><![CDATA[SSIS]]></category>

		<guid isPermaLink="false">http://blog.datainspirations.com/?p=706</guid>
		<description><![CDATA[The upcoming release of SQL Server 2012 includes a major overhaul for Integration Services (SSIS). I write about the changes in SSIS, big and small, in Introducing Microsoft SQL Server 2012 (Microsoft Press, 2012) which will be available in March as a free download. Meanwhile, if you really can&#8217;t wait that long, you can get [...]]]></description>
			<content:encoded><![CDATA[<p>The upcoming release of SQL Server 2012 includes a major overhaul for Integration Services (SSIS). I write about the changes in SSIS, big and small, in <a href="http://blogs.msdn.com/b/microsoft_press/archive/2012/01/20/release-schedule-for-our-free-introducing-microsoft-sql-server-2012-ebook.aspx" target="_blank">Introducing Microsoft SQL Server 2012 (Microsoft Press, 2012) </a>which will be available in March as a free download. Meanwhile, if you really can&#8217;t wait that long, you can get a sneak preview of a few chapters beginning February 1.</p>
<p>When writing a book like this which focuses on all the new stuff, it&#8217;s easy to get caught up in minutiae. As I begin to wind down the writing process for this book, I thought it would be interesting to step back and consider which enhancements I thought were particularly helpful for the package development process. There are certainly other enhancements that are helpful too, but the following list includes the ones that are special favorites of mine because they address problems that I encounter most often during my own package development or when teaching students about SSIS.</p>
<p>In no particular order, here is my list:</p>
<ol>
<li><strong>Interface overhaul</strong>. Business Intelligence Development Studio (BIDS) is now SQL Server Data Tools (SSDT), but that&#8217;s not the important part. Inside SSDT, the Toolbox window now includes a Favorites folder into which you can place components that you use regularly. I find that people can spend a lot of time hunting through the list of available components, so this feature can really help you out when there&#8217;s only a handful of components that you use in every package. There are several other changes to the interface, such as zoom control, and icons to specify whether a component succeeded or failed during package execution that improve the development experience as well.</li>
<li><strong>Shared Connection Managers</strong>. The idea of building something once for reuse many times is not new, and yet until now you&#8217;ve had to add the same connection managers to package after package, which turns into a rather tedious task if a change was required to each package&#8217;s connection manager. Now you can set up a connection manager once and reference it in multiple packages. As an added bonus when you use a Cache Connection Manager that you share between a parent and child package, the two packages share the same cache which optimizes performance for lookups against the same source in both packages.</li>
<li><strong>Undo and Redo</strong>. How many times have you made a change to a package and then instantly regretted it? I bet it&#8217;s happened at least once! Fortunately, the Undo button is now enabled so you can reverse that change, and the Redo button is available also in case you change your mind afterwards.</li>
<li><strong>Resolve References Editor</strong>. Managing metadata in the data flow pipeline is a concept with which many beginners struggle, especially when they make a change early in the data flow that has a ripple effect across the downstream components and causes metadata errors.  Now SSIS includes a Resolve References Editor that you can use to quickly resolve the mapping of input and output columns between components. You can use it to check that columns are mapped to one another properly, and also to see which columns remain unmapped.</li>
<li><strong>Variable scope</strong>. Here&#8217;s another commonly encountered problem. How many times have you added a variable only to realize later that you inadvertently assigned its scope to a task rather than to the package? Your only option was to delete the variable and add a new one while taking care to set the scope correctly. The new SSIS creates new variables at the package scope by default, and allows you to move an existing variable to a different scope.</li>
<li><strong>Left() function</strong>. In previous versions, you can use the Right() function or the Substring() function to work with portions of  a string, but there was no Left() function until the SQL Server 2012 release. Hooray!</li>
<li><strong>ReplaceNull() function</strong>. A very common task in data warehousing is to replace NULL values with some value. This new function just simplifies that task.</li>
<li><strong>Project deployment model and parameters</strong>.Working with SSIS projects and deployment is a completely new way of setting up packages to work in a new environment in SQL Server 2012, whether test or production. When you combine this deployment model with the use of parameters, you use parameters instead of configuration files to set run-time values for expressions. Most people didn&#8217;t understand what to do with configuration files, so this will be a welcome change indeed for that group. Even if you did work successfully with configuration files, you will likely still find it easier to set up parameters than configuration files.</li>
</ol>
<p>You can download the upcoming ebook to get more details about the items in my list above. Specifically, Chapter 6 covers Integration Services and is available now in the <a href="http://blogs.msdn.com/b/microsoft_press/archive/2011/10/11/free-ebook-introducing-microsoft-sql-server-code-name-denali-draft-preview.aspx" target="_blank">first draft of the ebook</a>. And come back to visit this blog often &#8211; I&#8217;ll be providing more details in the coming weeks about each of these items that space did not permit me to include in the ebook.</p>
<p>Meanwhile, you might also like these resources about SSIS and the upcoming release:</p>
<ul>
<li>The SSIS product development team provides <a href="http://blogs.msdn.com/b/mattm/" target="_blank">posts</a> from time to time to elaborate on various aspects of the product. You can use the Denali tag on the blog site to focus on the the new features of 2012.</li>
<li>Jamie Thomson has a <a href="http://sqlblog.com/blogs/jamie_thomson/archive/2011/07/12/ssis-enhancements-in-denali-ctp3.aspx" target="_blank">comprehensive list of changes with screen shots</a>, which after all are worth more than a thousand words!</li>
<li>Jamie also posted <a href=" http://sqlblog.com/blogs/jamie_thomson/archive/2011/07/16/ssis-logging-in-denali.aspx" target="_blank">an excellent walk-through of the level of detail that package execution can log in the SSIS catalog</a>.</li>
<li>Last, but not least, Jamie has published <a href="http://sqlblog.com/blogs/jamie_thomson/archive/2010/12/09/introducing-ssis-reporting-pack-for-sql-server-code-named-denali.aspx" target="_blank">a reporting pack</a> that helps you monitor logging in the SSIS catalog.</li>
</ul>
<p>I think my list of favorite enhancements is heavily biased by my experiences this week working with a new SSIS 2008 r2 developer. Perhaps you have a different set of favorites. If so, share your thoughts! Which SSIS features do you like best in the SQL Server 2012 release?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.datainspirations.com/2012/01/27/8-enhancements-in-integration-services-2012-for-easier-package-development/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Why Twitter? My Top 5 Reasons to Join In #Meme15</title>
		<link>http://blog.datainspirations.com/2012/01/17/why-twitter-my-top-5-reasons-to-join-in-meme15/</link>
		<comments>http://blog.datainspirations.com/2012/01/17/why-twitter-my-top-5-reasons-to-join-in-meme15/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 07:03:41 +0000</pubDate>
		<dc:creator>Stacia Misner</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://blog.datainspirations.com/?p=665</guid>
		<description><![CDATA[When I first heard about Twitter, I had zero interest. I&#8217;m not exactly known for being succinct, so how could I possibly say anything meaningful in 140 characters or less? More importantly, who would care? &#160; Then one day I received an email explaining that I had been mentioned by SQL_Joker on Twitter and could I [...]]]></description>
			<content:encoded><![CDATA[<div><a href="http://blog.datainspirations.com/wp-content/uploads/2012/01/meme15new.png"><img class="alignleft size-full wp-image-695" style="padding: 10px;" title="meme15new" src="http://blog.datainspirations.com/wp-content/uploads/2012/01/meme15new.png" alt="" width="150" height="150" /></a></div>
<div>When I first heard about Twitter, I had zero interest. I&#8217;m not exactly known for being succinct, so how could I possibly say anything meaningful in 140 characters or less? More importantly, who would care?</div>
<p>&nbsp;</p>
<p>Then one day I received an email explaining that I had been mentioned by <a href="http://twitter.com/sql_joker" target="_blank">SQL_Joker</a> on Twitter and could I make some time for a phone conversation to talk about a potential business opportunity? Well, that email got my curiosity piqued about this Twitter business, so I set up an account so that I could see for myself what the fuss was all about, and the rest &#8211; as they say &#8211; is history!</p>
<div></div>
<div></div>
<div><a href="http://www.jasonstrate.com/2012/01/january-meme15-assignment/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+StrateSql+%28Strate+SQL%29" target="_blank">This month&#8217;s #Meme15 topic</a>, hosted by Jason Strate (<a href="http://jasonstrate.com" target="_blank">blog</a>|<a href="http://twitter.com/StrateSQL" target="_blank">twitter</a>) asks the question why should the average Jane or Joe professional consider using Twitter? Based on my experiences after I first put my toe in the water, so to speak, I find Twitter to be one of my favorite ways to keep in touch with and be part of the SQL Server community. The key word there is &#8220;community.&#8221; Some even call it #SQLFamily.</div>
<div></div>
<div></div>
<div>All kinds of communities have sprung up on Twitter, some good, some not so good, so you can make of it what you will. But if you work with SQL Server and haven&#8217;t tried out Twitter, then you&#8217;re missing out on a terrific resource. Here are my top 5 reasons why you should consider <a href="http://twitter.com" target="_blank">signing up for Twitter</a> and joining us:</div>
<ol>
<li><strong>Get help with a problem</strong>. Whether you&#8217;re independent like me, working in a small shop, or out of resources in a big organization, there are people out there who might be able to help. Sometimes weird things happen and you need a fresh perspective for troubleshooting. Or you&#8217;ve been asked to start working with a different aspect of SQL Server and need a nudge in the right direction. With SQL Server professionals around the globe, someone out there is probably able to help. Don&#8217;t worry if no one knows who you are and isn&#8217;t following you &#8211; that will come with time. All you need to do is compose a tweet and add a hashtag at the end of your request &#8211; like #sqlhelp, #ssashelp, #ssishelp, or #ssrshelp. If you need more that 140 characters, then break your tweet into 2 parts and add 1/2 and 2/2 to each part. Before you tweet, you can use the search feature in Twitter to see tweets using these hashtags and learn what kinds of questions get answered. Obviously, it&#8217;s not the best way to get help for complex problems.</li>
<li><strong>Learn new things</strong>. Technology keeps changing and it can be challenging to stay current. As you learn who&#8217;s who in the SQL Server community, you can follow them to get breaking news, or thoughts about trends, or resources of interest. Don&#8217;t know who to follow? Start by watching who answers questions for the #sqlhelp and other hashtags, click the name, and click the Follow button. If you like what they tweet, do nothing but continue to watch the tweets. If you don&#8217;t like what they tweet, you can always Unfollow later. If you explore Twitter more deeply, you can also see who a person follows and who follows them. You might see some names you recognize as conference speakers, bloggers, and authors of magazine articles and books. Cast a wide net.</li>
<li><strong>Develop friendships with people who share common interests</strong>. Those of us in the SQL Server community have SQL Server in common. Often, the way we met one another was at conferences and that&#8217;s the only time we interacted from year to year. But with Twitter, we can continue the conversation. And with more conversation, the more we get to know one another and the friendships develop. And for those who can&#8217;t get to a conference, they can participate vicariously as many of us tweet interesting things that we hear and see. I&#8217;ve had Twitter exchanges with many people long before I met them, and some whom I&#8217;ve never met. So don&#8217;t feel like you have to know someone personally before you engage. Just be polite and friendly. Ask questions or offer up something you&#8217;ve learned. Before long, if you play nicely, you&#8217;ll be amazed at how you&#8217;ve been assimilated into the family.</li>
<li><strong>Have a laugh</strong>. We work hard and take our jobs seriously. Well, most of us do! But, seriously, we need a break from time to time, even if just for a few minutes. Every now and then, someone will come up with a topic and people begin to riff on that. You&#8217;ll see things like movies or books with names adapted to something meaningful and humorous only to those in the SQL Server community. You&#8217;ll just have to keep your eyes peeled to see what I mean.</li>
<li><strong>Work the network</strong>. As you get to know people on Twitter, you&#8217;ll find that you can get help in other ways besides the technical stuff. Maybe you need to find a job, or maybe you know of a job opening at your company. Twitter is a great way to share the need and someone might be able to help. I&#8217;ve heard lots of great stories of people getting connected in this way. Of course, having relationships built first is important. But this network of ours is not just about jobs. If you&#8217;re traveling some place new, or thinking about buying some new gadget, or need inspiration for a new way to fix something for dinner, someone in the community has an opinion that you might find useful.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.datainspirations.com/2012/01/17/why-twitter-my-top-5-reasons-to-join-in-meme15/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>16 Resources for Improving Your MDX Skills</title>
		<link>http://blog.datainspirations.com/2012/01/13/16-resources-for-improving-your-mdx-skills/</link>
		<comments>http://blog.datainspirations.com/2012/01/13/16-resources-for-improving-your-mdx-skills/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 10:17:13 +0000</pubDate>
		<dc:creator>Stacia Misner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.datainspirations.com/?p=650</guid>
		<description><![CDATA[If you&#8217;ve been following my recent series on MDX, which began with Location, Location, Location, you have learned some important concepts, but this series was merely an introduction and there is so much more to learn. To help you continue building your skills, here are a variety of resources that I recommend that you peruse. [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve been following my recent series on MDX, which began with <a title="SQLU MDX Week: Location, Location, Location" href="http://blog.datainspirations.com/2011/12/13/sqlu-mdx-week-location-location-location/" target="_blank">Location, Location, Location</a>, you have learned some important concepts, but this series was merely an introduction and there is so much more to learn. To help you continue building your skills, here are a variety of resources that I recommend that you peruse.</p>
<h3>Books</h3>
<ul>
<li><em><a href="http://www.amazon.com/Microsoft®-Server®-2008-Step-Microsoft/dp/0735626189/ref=sr_1_1?ie=UTF8&amp;qid=1326443512&amp;sr=8-1" target="_blank">SQL Server 2008 MDX Step by Step</a></em>, Bryan C. Smith, C. Ryan Clay, Hitachi Consulting (Microsoft Press, 2009). This book is useful for beginners, and leads you through the key concepts of MDX as the name implies&#8230;step by step. Although it&#8217;s written for SQL Server 2008, you will find it useful for SQL Server 2008 R2 as well and, although I haven&#8217;t tested it, it should work for SQL Server 2012.</li>
<li><em><a href="http://www.amazon.com/Microsoft-Server-Analysis-Services-Cookbook/dp/1849681309/ref=sr_1_1?s=books&amp;ie=UTF8&amp;qid=1326444296&amp;sr=1-1" target="_blank">MDX with SQL Server 2008 R2 Analysis Services Cookbook</a></em>, Tomislave Piasevoli (Packt Publishing, 2011). I really like this book, as you might surmise from <a title="Book Review: MDX with Microsoft SQL Server 2008 R2 Analysis Services Cookbook" href="http://blog.datainspirations.com/2011/10/21/book-review-mdx-with-microsoft-sql-server-2008-r2-analysis-services-cookbook/" target="_blank">my review</a>, and picked up a few tips myself. However, you&#8217;re not going to start learning MDX with this book. I recommend that you first read the Step by Step or some of the online resources first to get the most value from it.</li>
<li><em><a href="http://www.amazon.com/MDX-Solutions-Microsoft-Analysis-Services/dp/0471748080/ref=sr_1_1?s=books&amp;ie=UTF8&amp;qid=1326443745&amp;sr=1-1" target="_blank">MDX Solutions, 2<sup>nd</sup> edition</a>.</em> George Spofford, Sivakumar Harinath, Christopher Webb, and Dylan Hai Huang (Wiley, 2006). Although this book is focused on SQL Server 2005, much of it still applies to 2008 and later versions as the language remains largely intact. However, I must say this is not a book for beginners. There is lots of useful information here, but you will find it more useful if you already have a good grasp of the basics.</li>
<li><em><a href="http://www.amazon.com/Practical-MDX-Queries-Microsoft-Analysis/dp/0071713360/ref=sr_1_1?s=books&amp;ie=UTF8&amp;qid=1326444132&amp;sr=1-1" target="_blank">Practical MDX Queries for Microsoft SQL Server Analysis Services 2008</a></em>, Art Tennick (McGraw-Hill, 2010). I haven&#8217;t read this book yet, but it&#8217;s in my queue to read this year. If you&#8217;ve read it, I invite you to add a comment to this post with your impression.</li>
</ul>
<h3> Online Resources</h3>
<ul>
<li><a href="http://www.sqlservercentral.com/articles/Stairway+Series/71867/" target="_blank">Stairway to MDX Series</a>, I have long recommended Bill Pearson&#8217;s (<a href="http://twitter.com/Bill_Pearson" target="_blank">@Bill_Pearson</a>) online writings, such as <a href="http://www.databasejournal.com/features/mssql/article.php/1495511/MDX-at-First-Glance-Introduction-to-SQL-Server-MDX-Essentials.htm" target="_blank">MDX Essentials</a> at Database Journal, and of course must heartily recommend his latest endeavor at SQL Server Central.</li>
<li><a href="http://www.mosha.com/msolap/mdxstudio.htm" target="_blank">MDX Studio</a>. This resource is not one designed to teach you MDX, but I include it as a tool that you can use to improve your MDX as it is a tool that you can use to identify problems  in your query and to capture statistics for your query if you&#8217;re attempting to improve performance. Mosha, the developer of this tool, also developed <a href="http://mdx.mosha.com" target="_blank">an online version for formatting and analysis</a>.</li>
</ul>
<h3>Blogs</h3>
<ul>
<li><a class="zem_slink" title="Mosha Pasumansky" href="http://en.wikipedia.org/wiki/Mosha_Pasumansky" rel="wikipedia" target="_blank">Mosha Pasumansky</a> is one of the architects responsible for the MDX language, so what better resource could you ask for? He&#8217;s no longer at Microsoft, but fortunately his legacy persists at SQLBlog.com with <a href="http://sqlblog.com/blogs/mosha/default.aspx" target="_blank">many posts dedicated to providing insights into MDX</a>.</li>
<li>Chris Webb (<a href="http://twitter.com/Technitrain" target="_blank">@Technitrain</a>) is a coauthor of the second edition of the MDX Solutions mentioned above and writes frequently about  <a href="http://cwebbbi.wordpress.com/category/mdx/" target="_blank">MDX</a>. He has some very creative ideas that I have found useful in some of the more bleeding edge projects I have worked on.</li>
<li>Another terrific <a href="http://sqlblog.com/blogs/marco_russo/archive/tags/MDX/default.aspx" target="_blank">MDX</a> online resource is Marco Russo (<a href="http://twitter.com/marcorus" target="_blank">@MarcoRus</a>). Marco and Chris Webb (along with Alberto Ferrari) co-authored <a href="http://www.amazon.com/Expert-Development-Microsoft-Analysis-Services/dp/1847197221/ref=sr_1_1?ie=UTF8&amp;qid=1326446985&amp;sr=8-1" target="_blank">Expert Cube Development with Microsoft SQL Server 2008 Analysis Services</a> which I recommend if you want to learn more about developing the cubes that we use as a source for MDX queries.</li>
<li>Boyan Penev (<a href="http://twitter.com/boyanpenev" target="_blank">@BoyanPenev</a>) also writes on <a href="http://www.bp-msbi.com/category/10-ssas/" target="_blank">SSAS topics</a> that you might find helpful for improving your MDX skills</li>
<li>Greg Galloway has some interesting studies on MDX at his <a href="http://www.artisconsulting.com/blogs/greggalloway/Lists/Categories/Category.aspx?Name=MDX" target="_blank">blog</a>.</li>
<li>SSAS-info, run by Vidas Matelis (<a href="http://twitter.com/VidasM">@VidasM</a>) is a great aggregation site that includes <a href="http://ssas-info.com/analysis-services-faq/27-mdx" target="_blank">MDX topics</a>.</li>
<li>And of course, I have my own series which will expand over time, so keep checking back here for <a href="http://blog.datainspirations.com/tag/mdx/" target="_blank">everything I write on MDX</a>.</li>
</ul>
<h3>Whitepapers/Best Practices</h3>
<ul>
<li><a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=661" target="_blank">Identifying and Resolving MDX Query Performance Bottlenecks</a>. MDX performance is partly dependent on the choices you make when constructing the query and partly dependent on the cube structure. This whitepaper explains how to determine where to focus your attention for resolving query performance issues.</li>
<li><a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=3be0488d-e7aa-4078-a050-ae39912d2e43&amp;displaylang=en" target="_blank">Analysis Services 2008 Performance Guide</a>. Here you&#8217;ll find some good information about avoiding MDX functions that cause performance problems. You can use this whitepaper in conjunction with the performance bottleneck whitepaper to ferret out the problems you might be experiencing with slow queries.</li>
<li><a href="http://msdn.microsoft.com/en-US/library/cc966527%28v=technet.10%29.aspx" target="_blank">Analysis Services Query Performance Top 10 Best Practices</a>. As you build your MDX skills, it&#8217;s a very good idea to keep best practices in mind. This is  a nice quick reference to have handy.</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=0da8d4bc-5ef5-439b-8dc1-28ef89464892" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.datainspirations.com/2012/01/13/16-resources-for-improving-your-mdx-skills/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MDX: Adding a Simple Calculation to a Query</title>
		<link>http://blog.datainspirations.com/2012/01/03/mdx-adding-a-simple-calculation-to-a-query/</link>
		<comments>http://blog.datainspirations.com/2012/01/03/mdx-adding-a-simple-calculation-to-a-query/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 09:21:45 +0000</pubDate>
		<dc:creator>Stacia Misner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.datainspirations.com/?p=639</guid>
		<description><![CDATA[After an intermission for the holidays, I&#8217;m resuming my series of posts that provide an introduction to MDX. This series began with Location, Location, Location, and continued through A Gentle Introduction to Sets. At this point, you should have a good idea of the basic structure of a query using objects in an Analysis Services [...]]]></description>
			<content:encoded><![CDATA[<p>After an intermission for the holidays, I&#8217;m resuming my series of posts that provide an introduction to MDX. This series began with <a title="SQLU MDX Week: Location, Location, Location" href="http://blog.datainspirations.com/2011/12/13/sqlu-mdx-week-location-location-location/" target="_blank">Location, Location, Location</a>, and continued through <a title="SQLU MDX Week: A Gentle Introduction to Sets" href="http://blog.datainspirations.com/2011/12/16/sqlu-mdx-week-an-introduction-to-sets/" target="_blank">A Gentle Introduction to Sets</a>. At this point, you should have a good idea of the basic structure of a query using objects in an Analysis Services cube. In this post, I&#8217;m going to explain how you can expand your options by adding objects at query time.</p>
<p>You might do this during cube development to test out calculation syntax before adding it to the cube, or you might do this only when you need to run a one-time query to answer a specific question or test the cube. You can even use this technique for Reporting Services reports or with  other tools. But I have to recommend that, wherever possible, you should put calculations inside a cube which would render moot what I&#8217;m about to show you.  Why? So you don&#8217;t have to reinvent the wheel each time you need a calculation. One of the reasons we build cubes is to centralize business logic, which includes calculations. That said, some calculations can&#8217;t go in the cube. Whatever your reason, there will likely come a time that you&#8217;ll need a calculation added to your query, so the point of this post is to prepare you for that time.</p>
<p>We&#8217;ll start with an analogy in Excel, using a percent of total calculation as shown below. The formula consists of a numerator to get the sales amount on the current row and a denominator that references the total sales amount in cell B2. We use the terms relative reference and absolute reference to describe the values in the numerator and the denominator, respectively. So for Road-250 Black, 44 on row 4, we have a formula =B4/$B$2, where B4 is a relative reference and $B$2 is the absolute reference. As we paste the formula into rows 2, 3, and 5, the formula changes to =B2/$B$2, =B3/$B$2, and B5/$B$2.</p>
<p style="text-align: center;"><a href="http://blog.datainspirations.com/wp-content/uploads/2012/01/excel-03.gif"><img class="size-medium wp-image-640 aligncenter" title="excel-03" src="http://blog.datainspirations.com/wp-content/uploads/2012/01/excel-03-300x117.gif" alt="" width="300" height="117" /></a></p>
<p>We can get similar behavior in an MDX query by using tuples. I can create one tuple as an expression (the term we use in Analysis Services that corresponds to a formula in Excel) for the numerator, and a second tuple as an expression for the numerator. Let&#8217;s create a query that has a calculation for the numerator and denominator separately, and then a third calculation for the final calculation so that we can see the results independently.</p>
<p>First, I like to create the query with placeholders, just to get the query structure straight before I introduce anything else that might compromise the query as I add complexity. Not that this example is complex, but it&#8217;s a good habit to develop. Start simple, and build up from there. It&#8217;s too easy to mess yourself up with a stray comma or parenthesis. Note that we add in each expression in a WITH clause that precedes the SELECT statement, and that we add the expressions as measures. Then we can use them just like a measure that comes from the cube in the SELECT statement.</p>
<pre>WITH
MEMBER [Measures].[Numerator] AS NULL
MEMBER [Measures].[Denominator] AS NULL
MEMBER [Measures].[Pct of Total] AS NULL
SELECT
{[Measures].[Sales Amount],[Measures].[Numerator],[Measures].[Denominator],[Measures].[Pct of Total]}
ON COLUMNS,
[Product].[Category].Members ON ROWS
FROM [Adventure Works]
</pre>
<p>&nbsp;</p>
<p><a href="http://blog.datainspirations.com/wp-content/uploads/2012/01/mdx-091.gif"><img class="aligncenter size-full wp-image-643" title="mdx-09" src="http://blog.datainspirations.com/wp-content/uploads/2012/01/mdx-091.gif" alt="" width="387" height="118" /></a></p>
<p>Now let&#8217;s update the numerator expression by replacing NULL with [Measures].[Sales Amount]. You can see below that the query result simply repeats the sales amount value from the first column in the second column. Let&#8217;s review what we know about tuples from <a title="SQLU MDX Week: Location, Location, Location" href="http://blog.datainspirations.com/2011/12/13/sqlu-mdx-week-location-location-location/" target="_blank">Location, Location, Location</a>. When the query resolves the tuple for the second column, the current measure &#8211; [Measures].[Numerator] &#8211; doesn&#8217;t really exist in the cube, but its expression redirects to [Measures].[Sales Amount] which then gets combined with the category member on each row to produce a tuple which in turn resolves as a value retrieved from the cube. Just like the tuples for each value in the first column. This tuple is like the relative reference we saw in the Excel example &#8211; Sales Amount varies according to the row.</p>
<p><a href="http://blog.datainspirations.com/wp-content/uploads/2012/01/mdx-10.gif"><img class="aligncenter size-full wp-image-644" title="mdx-10" src="http://blog.datainspirations.com/wp-content/uploads/2012/01/mdx-10.gif" alt="" width="419" height="115" /></a></p>
<p>Next let&#8217;s update the denominator expression by replacing NULL with a tuple expression: ([Measures].[Sales Amount], [Product].[Category].[All Products]). This time the query results shown below repeat the tuple value that we see at the intersection of the first column and first row. When the query resolves the tuple for the third column, both the measure in the tuple and the category member come from the expression. Thus, we get a constant value for each row in the third column. This tuple is like the absolute value in the Excel example.</p>
<p><a href="http://blog.datainspirations.com/wp-content/uploads/2012/01/mdx-12.gif"><img class="aligncenter size-full wp-image-646" title="mdx-12" src="http://blog.datainspirations.com/wp-content/uploads/2012/01/mdx-12.gif" alt="" width="438" height="114" /></a></p>
<p>So let&#8217;s ponder tuple behavior in query results again for a moment. Simply put, a tuple resolves as by combining the current column member, the current row member, and whatever members are in the WHERE clause (aka the slicer). If a member on rows, on columns, or in the WHERE clause is a calculated member, then whatever member the calculated member references in the expression will be overridden in the current row, column, or slicer member. If the expression is complex &#8211; that is, composed of operations on multiple tuples &#8211; then the contents of each tuple is evaluated independently. Thus, in the percent of total calculation, we have the numerator changing dynamically as row members change but the denominator remaining constant.</p>
<p>Putting the pieces together, we get the final query as shown below. Notice the FORMAT_STRING property added to the Pct of Total expression to get a percentage format. It&#8217;s not necessary for Numerator or Denominator because the use of Sales Amount directly (rather than as part of a computation) results in the use of the currency format string as defined for the measure in the cube.</p>
<pre>WITH
MEMBER [Measures].[Numerator] AS [Measures].[Sales Amount]
MEMBER [Measures].[Denominator] AS ([Measures].[Sales Amount], [Product].[Category].[All Products])
MEMBER [Measures].[Pct of Total] AS [Measures].[Numerator] / [Measures].[Denominator], FORMAT_STRING='Percent'
SELECT
{[Measures].[Sales Amount],[Measures].[Numerator],[Measures].[Denominator],[Measures].[Pct of Total]}
ON COLUMNS,
[Product].[Category].Members ON ROWS
FROM [Adventure Works]</pre>
<div><a href="http://blog.datainspirations.com/wp-content/uploads/2012/01/mdx-11.gif"><img class="aligncenter size-full wp-image-645" title="mdx-11" src="http://blog.datainspirations.com/wp-content/uploads/2012/01/mdx-11.gif" alt="" width="439" height="114" /></a></div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.datainspirations.com/2012/01/03/mdx-adding-a-simple-calculation-to-a-query/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MDX &#8211; More to Come!</title>
		<link>http://blog.datainspirations.com/2011/12/26/mdx-more-to-come/</link>
		<comments>http://blog.datainspirations.com/2011/12/26/mdx-more-to-come/#comments</comments>
		<pubDate>Mon, 26 Dec 2011 22:44:40 +0000</pubDate>
		<dc:creator>Stacia Misner</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://blog.datainspirations.com/?p=629</guid>
		<description><![CDATA[Although my recent series was of MDX posts, ending with A Gentle Introduction to Sets, was intended merely to be an introduction to MDX, and not a full-fledged course, I have a few more things to share with you! I had hoped I could wrap it up last week. As it turns out, I needed [...]]]></description>
			<content:encoded><![CDATA[<p>Although my recent series was of MDX posts, ending with <a title="SQLU MDX Week: A Gentle Introduction to Sets" href="http://blog.datainspirations.com/2011/12/16/sqlu-mdx-week-an-introduction-to-sets/" target="_blank">A Gentle Introduction to Sets</a>, was intended merely to be an introduction to MDX, and not a full-fledged course, I have a few more things to share with you! I had hoped I could wrap it up last week. As it turns out, I needed the entire week to finish a chapter for the <a title="Introducing Microsoft SQL Server 2012" href="http://blogs.msdn.com/b/microsoft_press/archive/2011/10/11/free-ebook-introducing-microsoft-sql-server-code-name-denali-draft-preview.aspx" target="_blank">Introducing Microsoft SQL Server 2012</a> book. </p>
<p>Compounding the delay is the fact that I&#8217;m currently in my remote Alaskan home and the Internet situation is still getting ironed out. It  has taken me over 20 minutes just to get this simple little explanation post put out there for you. (It&#8217;s PAINfully slow, but at least I have a beautiful view while I wait!) Besides, you should be doing something else as the year winds down! I promise there will be more to come. Either as soon as my Internet speeds up or when I get back to the mainland &#8211; whichever comes first!</p>
<p><a href="http://blog.datainspirations.com/wp-content/uploads/2011/12/Christmas-Morning-2011.jpg"><img src="http://blog.datainspirations.com/wp-content/uploads/2011/12/Christmas-Morning-2011-300x185.jpg" alt="" title="Christmas Morning 2011" width="300" height="185" class="aligncenter size-medium wp-image-633" /></a></p>
<p>Wishing you a very Happy New Year!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.datainspirations.com/2011/12/26/mdx-more-to-come/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQLU MDX Week: A Gentle Introduction to Sets</title>
		<link>http://blog.datainspirations.com/2011/12/16/sqlu-mdx-week-an-introduction-to-sets/</link>
		<comments>http://blog.datainspirations.com/2011/12/16/sqlu-mdx-week-an-introduction-to-sets/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 12:51:15 +0000</pubDate>
		<dc:creator>Stacia Misner</dc:creator>
				<category><![CDATA[Analysis Services]]></category>
		<category><![CDATA[MDX]]></category>
		<category><![CDATA[SQL University]]></category>

		<guid isPermaLink="false">http://blog.datainspirations.com/?p=611</guid>
		<description><![CDATA[Welcome to my third post in a series of topics on MDX for SQL University. If you&#8217;re just now joining me, you should check out the first post, Location, Location, Location, and my previous post, Writing Simple Queries, to get oriented. I&#8217;m going to continue building on the concepts introduced in the earlier posts by showing [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sqlchicken.com/sql-university" target="_blank"><img class="size-full wp-image-428 alignleft" title="SQL University" src="http://blog.datainspirations.com/wp-content/uploads/2011/05/SQL_University.png" alt="" width="175" height="200" /></a><br />
Welcome to my third post in a series of topics on MDX for <a href="http://sqlchicken.com/sql-university/" target="_blank">SQL University</a>. If you&#8217;re just now joining me, you should check out the first post, <a title="SQLU MDX Week: Location, Location, Location" href="http://blog.datainspirations.com/2011/12/13/sqlu-mdx-week-location-location-location/" target="_blank">Location, Location, Location</a>, and my previous post, <a title="SQLU MDX Week: Writing Simple Queries" href="http://blog.datainspirations.com/2011/12/14/sqlu-mdx-week-writing-simple-queries/" target="_blank">Writing Simple Queries</a>, to get oriented. I&#8217;m going to continue building on the concepts introduced in the earlier posts by showing you how to use functions to create a set to use on an axis.</p>
<p>Many times you&#8217;re interested in seeing values for all of the members of a particular attribute hierarchy. For example, in this query, we can see sales for all categories and for all years, including a grand total for categories and years and also years that have no sales.</p>
<pre>SELECT
[Date].[Calendar Year].Members
 ON COLUMNS,
[Product].[Category].Members ON ROWS
FROM [Adventure Works]
WHERE [Measures].[Sales Amount]</pre>
<p style="text-align: center;"><a href="http://blog.datainspirations.com/wp-content/uploads/2011/12/mdx-05.gif"><img class="aligncenter size-full wp-image-613" title="mdx-05" src="http://blog.datainspirations.com/wp-content/uploads/2011/12/mdx-05.gif" alt="" width="529" height="112" /></a></p>
<p>When you use the Members function with a dimension and hierarchy, you get everything listed in the Members folder:</p>
<p style="text-align: center;"><a href="http://blog.datainspirations.com/wp-content/uploads/2011/12/members.gif"><img class="aligncenter size-full wp-image-614" title="members" src="http://blog.datainspirations.com/wp-content/uploads/2011/12/members.gif" alt="" width="204" height="193" /></a></p>
<p>What if you don&#8217;t want the All Periods member to show up? Well, you could create a set like this {[Date].[Calendar].[CY 2005], [Date].[Calendar.[CY 2006], &#8230;} but that would be tedious, and it wouldn&#8217;t automatically include new members that get added to the dimension over time. Instead, you can use the Members function with the dimension, hierarchy, and level reference to skip over the All Periods like this:</p>
<pre>SELECT
[Date].[Calendar Year].[Calendar Year].Members
 ON COLUMNS,
[Product].[Category].Members ON ROWS
FROM [Adventure Works]
WHERE [Measures].[Sales Amount]</pre>
<p style="text-align: center;"><a href="http://blog.datainspirations.com/wp-content/uploads/2011/12/mdx-06.gif"><img class="aligncenter size-full wp-image-615" title="mdx-06" src="http://blog.datainspirations.com/wp-content/uploads/2011/12/mdx-06.gif" alt="" width="450" height="97" /></a></p>
<p>Here we have a case of &#8220;more is less.&#8221; When we use a level reference, such as we do with the expression [Date].[Calendar Year].[Calendar Year].Members, we are providing more specific instructions to the Members function so that we can get less data. Using a level reference works with both attribute hierarchies (the ones with two levels only) and user-defined hierarchies (the ones with multiple levels and a pyramid-shaped icon).</p>
<p style="text-align: center;"><a href="http://blog.datainspirations.com/wp-content/uploads/2011/12/level-members.gif"><img class="aligncenter size-full wp-image-616" title="level-members" src="http://blog.datainspirations.com/wp-content/uploads/2011/12/level-members.gif" alt="" width="198" height="230" /></a></p>
<p>One more little change to this query might make it better. If we don&#8217;t want to see CY 2009 and CY 2010 columns when they are empty, we add the NON EMPTY keyword in front of the set definition like this:</p>
<pre>SELECT
NON EMPTY [Date].[Calendar Year].[Calendar Year].Members
 ON COLUMNS,
[Product].[Category].Members ON ROWS
FROM [Adventure Works]
WHERE [Measures].[Sales Amount]</pre>
<p>What if we want to see the category sales broken down not only by year, but also by sales territory? We can combine sets on an axis using the CrossJoin function like this:</p>
<pre>SELECT
NON EMPTY [Date].[Calendar Year].[Calendar Year].Members
 ON COLUMNS,
NON EMPTY
CrossJoin([Product].[Category].Members,
	[Sales Territory].[Sales Territory Group].[Sales Territory Group].Members)
ON ROWS
FROM [Adventure Works]
WHERE [Measures].[Sales Amount]</pre>
<pre><a href="http://blog.datainspirations.com/wp-content/uploads/2011/12/mdx-07.gif"><img class="aligncenter size-full wp-image-619" title="mdx-07" src="http://blog.datainspirations.com/wp-content/uploads/2011/12/mdx-07.gif" alt="" width="423" height="248" /></a></pre>
<p>The CrossJoin function takes only two arguments, but you can use that expression as one argument in a second CrossJoin function to create a grouping of three dimension hierarchies on an axis. There are several ways to get the crossjoin effect which might be easier to read when you start adding more dimension hierarchies to the mix. One is the use of a &#8220;polymorphic operator&#8221; such as an asterisk * like this:</p>
<pre>[Product].[Category].Members *
[Sales Territory].[Sales Territory Group].[Sales Territory Group].Members</pre>
<p>The other is to create a tuple set like this:</p>
<pre>([Product].[Category].Members,
[Sales Territory].[Sales Territory Group].[Sales Territory Group].Members)</pre>
<p>I know I said in a previous post that a tuple is like a coordinate to a cell, and it appears in the above example that I&#8217;m violating that rule by using sets in a tuple. But Analysis Services resolves this expression as a set of tuples by taking every member of the first set (the product category members) to create a tuple with every member of the second set (sales territory group members).  That set gets placed on the rows axis and the set of calendar year members gets placed on the columns axis, and then the tuple coordinates for each intersection of a row and a column produces a new tuple definition that generates a result, such as $709,947.20 for the pseudo-tuple (All Products, Europe, CY 2005).</p>
<p>There are many more functions that we can use to generate sets to control what we see on rows or columns. More than I can cover in this post. (In fact, there are entire books that cover this topic. In a future post, I&#8217;ll provide some recommendations.) For now, I&#8217;ll leave you with one more function to add to your repertoire. This time we want to see only those product categories and sales territory combinations that have sales greater than $1 million in CY 2008, but we want to see their sales for all years. To do this, we use the Filter function. This should satiate your desire to use a WHERE clause in your query, which I told you in my previous post does not work like a filter as it does in a T-SQL query.</p>
<pre>SELECT
NON EMPTY [Date].[Calendar Year].[Calendar Year].Members
 ON COLUMNS,
Filter(
	([Product].[Category].[Category].Members,
		[Sales Territory].[Sales Territory Group].[Sales Territory Group].Members),
	([Measures].[Sales Amount],[Date].[Calendar Year].&amp;[2008])  &gt; 1000000)
ON ROWS
FROM [Adventure Works]
WHERE [Measures].[Sales Amount]</pre>
<p><a href="http://blog.datainspirations.com/wp-content/uploads/2011/12/mdx-08.gif"><img class="aligncenter size-full wp-image-620" title="mdx-08" src="http://blog.datainspirations.com/wp-content/uploads/2011/12/mdx-08.gif" alt="" width="520" height="98" /></a></p>
<p>The Filter function takes two arguments. The first is the set that you want to filter. And the second is a Boolean expression that determines which members will be in the set that the Filter function produces. In this case, I used a tuple expression to focus on the 2008 sales.  If I had used only Sales Amount, the filter would have produced a set of category/territory combinations having total sales for all years greater than $1 million.</p>
<p>The key concept to take away from this post is that sets go on rows and columns, and that we can control very precisely which members are in those sets by using functions and tuple sets. A very common function to use is the Members function, and it&#8217;s also common to use NON EMPTY to rid ourselves of rows or columns that contain only null values.</p>
<pre></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.datainspirations.com/2011/12/16/sqlu-mdx-week-an-introduction-to-sets/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

