<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Gobán Saor</title>
	<atom:link href="http://blog.gobansaor.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.gobansaor.com</link>
	<description>A country datasmith.</description>
	<lastBuildDate>Fri, 27 Jan 2012 10:22:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.gobansaor.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/67e164f5d51c2b3115a7819b84505c13?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Gobán Saor</title>
		<link>http://blog.gobansaor.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.gobansaor.com/osd.xml" title="Gobán Saor" />
	<atom:link rel='hub' href='http://blog.gobansaor.com/?pushpress=hub'/>
		<item>
		<title>Death of the Star Schema?</title>
		<link>http://blog.gobansaor.com/2012/01/19/death-of-the-star-schema/</link>
		<comments>http://blog.gobansaor.com/2012/01/19/death-of-the-star-schema/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 16:43:48 +0000</pubDate>
		<dc:creator>gobansaor</dc:creator>
				<category><![CDATA[BI]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[PowerPivot]]></category>
		<category><![CDATA[Datawarehouse]]></category>
		<category><![CDATA[Star Schema]]></category>

		<guid isPermaLink="false">http://blog.gobansaor.com/?p=2336</guid>
		<description><![CDATA[With the release of the next version of PowerPivot around the corner (mid March I think), I&#8217;ve been re-acquainting myself with its new features. Most of the current version&#8217;s annoyances have been remedied (no drill-thru, no hierarchy support for example); &#8230; <a href="http://blog.gobansaor.com/2012/01/19/death-of-the-star-schema/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gobansaor.com&amp;blog=110633&amp;post=2336&amp;subd=gobansaor&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.gobansaor.com/2012/01/19/death-of-the-star-schema/death-of-a-star/" rel="attachment wp-att-2337"><img class="alignleft size-full wp-image-2337" title="death of a star" src="http://gobansaor.files.wordpress.com/2012/01/death-of-a-star.jpg?w=500" alt=""   /></a>With the release of the next version of PowerPivot around the corner (mid March I think), I&#8217;ve been re-acquainting myself with its new features. Most of the current version&#8217;s annoyances have been remedied (no drill-thru, no hierarchy support for example); and the additional enhancements to the DAX language (crossjoins, alternate relationships etc) make modelling m0st any problem possible (and generally easy).</p>
<p>The more I come to know PowerPivot, the more I believe that modelled <a class="zem_slink" title="Data warehouse" href="http://en.wikipedia.org/wiki/Data_warehouse" rel="wikipedia">data warehouses</a>&#8216; days are numbered. I didn&#8217;t say data warehouses per se, rather those that attempt to centrally model end user reporting structures (usually as star-schemas).</p>
<p>There will continue to be a need for centrally controlled data warehouses (or at least simplified data views (and/or copies) of operational datasets, either provided by system vendors of by in-house IT) to bridge the <em>raw-to-actionable data gap. </em>But I suspect <a href="http://www.capgemini.com/technology-blog/2012/01/service-reporting-good-traditional-bi-bad/">the emphasis will change</a> from providing finished goods to providing semi-processed raw materials.</p>
<p>So, will the <a class="zem_slink" title="Star schema" href="http://blog.gobansaor.com/2010/07/09/star-schemas-to-boldly-go-where-no-excel-spreadsheet-has-gone-before/" rel="wikipedia">star-schema</a> become redundant? No, as it still a valid method of modelling a reporting requirement in order to make many queries simpler to phrase (this obviously applies to SQL , but also to DAX queries). But, those who build them will be doing so closer to the problem at hand, and specific to that problem (I&#8217;ve discussed this before in <a href="http://blog.gobansaor.com/2011/01/08/slowly-changing-dimensions-time-to-stop-worrying/">http://blog.gobansaor.com/2011/01/08/slowly-changing-dimensions-time-to-stop-worrying/</a>).</p>
<p>For many reports the barely modified operational data model will be all that&#8217;s required (for example, DAX doesn&#8217;t require &#8220;fact&#8221; header/detail tables to be flattened to detail level, as would be the case with a classic star).</p>
<p>&#8220;Good Enough&#8221; models will become the norm; classic &#8220;Everything You Ever Wanted to Know&#8221; centralised models a luxury for most (especially as such models tend to &#8220;age&#8221; very quickly).</p>
<p>If you&#8217;re about to invest or re-furbish your data warehouse or your reporting data sub-systems, don&#8217;t do so without first taking a serious look at PowerPivot. This is a game-changer, not just for full-stack Microsoft BI shops, but for any business that finds that their reporting datasets invariably end-up in Excel.</p>
<p>If you need any help evaluating PowerPivot or modelling your reporting needs in PowerPivot, <a href="http://www.gobansaor.com/excel-based-bi?dofstar=1"> I&#8217;m for hire</a>.</p>
<p><strong>Update:</strong></p>
<p>Just in case you think I&#8217;m an dimensional-model un-believer or likely to abandon my star-schema roots read this&#8230;.</p>
<p style="padding-left:30px;"><a href="http://blog.gobansaor.com/2010/07/09/star-schemas-to-boldly-go-where-no-excel-spreadsheet-has-gone-before/">Star Schemas: to explore strange new conformed dimensions, to seek out new measures, to boldly go where no Excel spreadsheet has gone before.</a></p>
<p style="padding-left:30px;"><a href='http://twitter.com/gobansaor' class='twitter-follow-button' data-text-color='#333333' data-link-color='#0060ff'>Follow @gobansaor</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gobansaor.wordpress.com/2336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gobansaor.wordpress.com/2336/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gobansaor.wordpress.com/2336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gobansaor.wordpress.com/2336/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gobansaor.wordpress.com/2336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gobansaor.wordpress.com/2336/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gobansaor.wordpress.com/2336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gobansaor.wordpress.com/2336/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gobansaor.wordpress.com/2336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gobansaor.wordpress.com/2336/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gobansaor.wordpress.com/2336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gobansaor.wordpress.com/2336/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gobansaor.wordpress.com/2336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gobansaor.wordpress.com/2336/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gobansaor.com&amp;blog=110633&amp;post=2336&amp;subd=gobansaor&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gobansaor.com/2012/01/19/death-of-the-star-schema/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<georss:point>53.204039 -6.574340</georss:point>
		<geo:lat>53.204039</geo:lat>
		<geo:long>-6.574340</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b714f82b5e24beb3b74779615b6ad969?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">gobansaor</media:title>
		</media:content>

		<media:content url="http://gobansaor.files.wordpress.com/2012/01/death-of-a-star.jpg" medium="image">
			<media:title type="html">death of a star</media:title>
		</media:content>
	</item>
		<item>
		<title>PowerPivot VBA Refresh Code &#8211; Bug Fix</title>
		<link>http://blog.gobansaor.com/2011/11/22/powerpivot-vba-refesh-code-bug-fix/</link>
		<comments>http://blog.gobansaor.com/2011/11/22/powerpivot-vba-refesh-code-bug-fix/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 17:05:05 +0000</pubDate>
		<dc:creator>gobansaor</dc:creator>
				<category><![CDATA[ETL]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[HAMMER]]></category>
		<category><![CDATA[PowerPivot]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[Automate PowerPivot refresh]]></category>
		<category><![CDATA[PowerPivot VBA Bug Fix]]></category>
		<category><![CDATA[PowerPivot VBA Refresh]]></category>

		<guid isPermaLink="false">http://blog.gobansaor.com/?p=2310</guid>
		<description><![CDATA[Just a quick post to alert those of you using my PowerPivot Refresh code to a bug in its &#8220;refresh a single table&#8221; logic. Under certain circumstances, linked tables (i.e. those on the &#8220;many&#8221; side of a relationship) will fail to &#8230; <a href="http://blog.gobansaor.com/2011/11/22/powerpivot-vba-refesh-code-bug-fix/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gobansaor.com&amp;blog=110633&amp;post=2310&amp;subd=gobansaor&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/guitavares/1703252007/"><img class="alignleft size-full wp-image-2311" title="" src="http://gobansaor.files.wordpress.com/2011/11/bug.jpg?w=500" alt=""   /></a>Just a quick post to alert those of you using my PowerPivot Refresh code to a bug in its &#8220;refresh a single table&#8221; logic. Under certain circumstances, linked tables (i.e. those on the &#8220;many&#8221; side of a relationship) will fail to refresh if specified individually (fine when part of a refresh all). S<a href="http://blog.gobansaor.com/2011/09/09/hammering-away-at-automated-powerpivot-refresh/#comment-7886">ee here for the details behind the bug</a>, and thanks again to Rob Parker for bringing it to my attention. I&#8217;ve updated the sample code with the fix, <a href="http://www.gobansaor.com/excel-based-bi">download it here</a>.</p>
<p>I&#8217;ve also tested the code against the just released <a href="http://www.microsoft.com/download/en/details.aspx?id=28150">SQLServer 2010 RC0 version of PowerPivot </a>and it appears to work.</p>
<p>I&#8217;ve updated the equivalent PPREFRESH code in HAMMER and this is now part of the tool&#8217;s latest release (V1.3.4(Beta)). My previous post,<a href="http://blog.gobansaor.com/2011/11/05/excel-as-a-book-of-record/"> Excel as a Book of Record</a>, previewed the most important new commands available in this release. Alongside those, I&#8217;ve also added the following:</p>
<ul>
<li>ISTABLE, if the previous COMMAND&#8217;s result  or the previous argument is not a table, this will abend the command sequence.</li>
<li>ISARG, as above, but this time checks for an argument (a HAMMER parameter may either be a table, a command or an argument- aka, an ARG).</li>
<li>ISOK, previous argument must be the string value &#8220;OK&#8221;.</li>
<li>TABLESARETHESAME, will fail if the last two tables are not identical. Intended mainly for automated regression testing.</li>
<li>ARGSARETHESAME, as above. but this time for ARGS.</li>
<li>_GUID, will return a globally unique identifier.</li>
</ul>
<p><a href="http://www.gobansaor.com/microetl">Download the latest version of HAMMER from here …</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gobansaor.wordpress.com/2310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gobansaor.wordpress.com/2310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gobansaor.wordpress.com/2310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gobansaor.wordpress.com/2310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gobansaor.wordpress.com/2310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gobansaor.wordpress.com/2310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gobansaor.wordpress.com/2310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gobansaor.wordpress.com/2310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gobansaor.wordpress.com/2310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gobansaor.wordpress.com/2310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gobansaor.wordpress.com/2310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gobansaor.wordpress.com/2310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gobansaor.wordpress.com/2310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gobansaor.wordpress.com/2310/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gobansaor.com&amp;blog=110633&amp;post=2310&amp;subd=gobansaor&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gobansaor.com/2011/11/22/powerpivot-vba-refesh-code-bug-fix/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<georss:point>53.204039 -6.574340</georss:point>
		<geo:lat>53.204039</geo:lat>
		<geo:long>-6.574340</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b714f82b5e24beb3b74779615b6ad969?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">gobansaor</media:title>
		</media:content>

		<media:content url="http://gobansaor.files.wordpress.com/2011/11/bug.jpg" medium="image" />
	</item>
		<item>
		<title>Excel as a book of record.</title>
		<link>http://blog.gobansaor.com/2011/11/05/excel-as-a-book-of-record/</link>
		<comments>http://blog.gobansaor.com/2011/11/05/excel-as-a-book-of-record/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 12:48:06 +0000</pubDate>
		<dc:creator>gobansaor</dc:creator>
				<category><![CDATA[AmazonAWS]]></category>
		<category><![CDATA[ETL]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[HAMMER]]></category>
		<category><![CDATA[S3]]></category>
		<category><![CDATA[Steam Powered Server]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[Excel JSON]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[VBA JSON]]></category>

		<guid isPermaLink="false">http://blog.gobansaor.com/?p=2264</guid>
		<description><![CDATA[In the past I&#8217;ve talked about Excel as a tool to develop Really Simple Systems. Such &#8220;systems&#8221; usually occupy the middle ground between continuing to do a task by hand or  investing time/money in using a packaged/bespoke &#8220;proper system&#8221;. When &#8230; <a href="http://blog.gobansaor.com/2011/11/05/excel-as-a-book-of-record/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gobansaor.com&amp;blog=110633&amp;post=2264&amp;subd=gobansaor&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.gobansaor.com/2011/11/05/excel-as-a-book-of-record/book_of_record/" rel="attachment wp-att-2279"><img class="alignleft size-full wp-image-2279" title="book_of_record" src="http://gobansaor.files.wordpress.com/2011/11/book_of_record.jpg?w=500" alt=""   /></a>In the past I&#8217;ve talked about Excel as a tool to develop <a href="http://blog.gobansaor.com/2011/04/19/really-simple-systems/">Really Simple Systems</a>. Such &#8220;systems&#8221; usually occupy the middle ground between continuing to do a task by hand or  investing time/money in using a packaged/bespoke &#8220;proper system&#8221;.</p>
<p>When such systems are primarily reporting in emphasis, the justification for using Excel is usually straight forward and compelling (and getting even more compelling with the appearance on the scene of Excel 2010&#8242;s  PowerPivot.) But, alarm bells sound across the world of professional IT when Excel is proposed as a &#8220;book of record&#8221; i.e. when it&#8217;s to be used to store and maintain a business critical dataset. And, with some considerable justification, the nightmare that is linked (or even worse, shared) workbooks is very real indeed. But yet, businesses continue to do so, and do so quite successfully.</p>
<p>I myself record my business as a series of Excel documents (Invoices, Timesheets, Expenses) in a set of folders (Financial Years subdivided into major customers).  Essentially a <a class="zem_slink" title="Document-oriented database" href="http://en.wikipedia.org/wiki/Document-oriented_database" rel="wikipedia">document-oriented database</a>.</p>
<p>In the past I simply then used a VBA powered workbook to open the required &#8220;documents&#8221; and extracted the data necessary for whatever report I required (VAT, year-end etc.).  To better automate (i.e. less bespoke VBA) this task I&#8217;ve have made changes to <a href="http://www.gobansaor.com/microetl">HAMMER</a> to help with this and with similar tasks for clients.</p>
<p>The following list of commands will be added to the next release of HAMMER. (In the meantime these new functions <a href="http://bit.ly/rss_example1">can be previewed here</a> &#8230;)</p>
<h2>LISTOFFILES</h2>
<p>This command takes a single argument, the folder to search, and will return a table of files in that folder and in any sub-folders. The result can then be used to select a list of files for further processing.</p>
<p>Example:</p>
<p>=HAMMER(&#8220;C:\a\rss&#8221;,&#8221;LISTOFFILES&#8221;)</p>
<p><a href="http://blog.gobansaor.com/2011/11/05/excel-as-a-book-of-record/listoffiles/" rel="attachment wp-att-2267"><img class="aligncenter size-full wp-image-2267" title="listoffiles" src="http://gobansaor.files.wordpress.com/2011/11/listoffiles.png?w=500&#038;h=93" alt="" width="500" height="93" /></a></p>
<h2>_XLTOJSONDOC</h2>
<p>This command takes a list of workbooks, opens each one, checks for a list of named ranges and generates a <a class="zem_slink" title="JSON" href="http://en.wikipedia.org/wiki/JSON" rel="wikipedia">JSON</a> document. The command is intended to be called from within a VBA macro (as opening and closing workbook breaks the &#8220;no side effects&#8221; rule of UDFs). Most &#8220;_&#8221; commands such as &#8220;_MD5&#8243; etc. are likewise intended for &#8220;programming use&#8221;, but any command beginning with &#8220;_XL&#8221; must be restricted to macro (i.e. non-UDF) use.</p>
<p>See the example workbook FetchInventory for an example of this function in action. The function takes one argument (the name of the document to load) and expects a table where the last column is the full name of the workbook to open. Any columns in the source table will be copied to the new &#8220;JSON document&#8221; table with an additional column called &#8220;Document&#8221; which will hold a JSON document representing the key-name pairs and table(s) extracted from the workbook.</p>
<p>On opening a workbook, it is searched for a named range with the name of document concatenated with &#8220;_fields&#8221; (e.g. INVENTORY_fields). The value of this range is expected to be a CSV list of fields and tables to load. A single Excel &#8220;document&#8221; could contain multiple logical documents (each specified by its own &#8220;_fields&#8221; list) .</p>
<p>See the PartsInventory_bin4 for an example of a multi-document workbook (INVENTORY and EXAMPLE). The EXAMPLE document in this workbook also demonstrates the various types of tables handled.</p>
<p>Example:</p>
<p>lJSONObjects = oHammer.HAMMER(&#8220;C:\a\rss\StockTake1&#8243;,&#8221;LISTOFFILES&#8221;,&#8221;Select name,fullname from table2 limit 1&#8243;,&#8221;SQL&#8221;,&#8221;INVENTORY&#8221;,&#8221;_XLTOJSONDOC&#8221;)</p>
<p>lReturn = oHammer.HAMMERToRange(lJSONObjects,&#8221;Sheet2!A27&#8243;)</p>
<p>&#8230; will output</p>
<p><a href="http://blog.gobansaor.com/2011/11/05/excel-as-a-book-of-record/documentrow/" rel="attachment wp-att-2270"><img class="aligncenter size-full wp-image-2270" title="documentrow" src="http://gobansaor.files.wordpress.com/2011/11/documentrow.png?w=500&#038;h=72" alt="" width="500" height="72" /></a></p>
<h2>JSONDOCVIEW</h2>
<p>This command is where the previous commands are leading to, i.e. extracting some real information value from your documents. It converts JSON documents into Excel friendly tables. It is, in essence, a Map function as in <a href="http://en.wikipedia.org/wiki/MapReduce">MapReduce</a>. In a previous example I used a <a href="http://blog.gobansaor.com/2011/05/05/excel-document-oriented-database-with-python-map-sql-reduce/">Python Map and a SQL Reduce</a>, here, both Map and Reduce are via SQL (the command uses a series of SQL commands to perform its task).</p>
<p>Before I describe the function let me explain why I use an intermediate JSON format. I could just extract the data directly from each document and either store directly in Excel or create tables in SQLite of Access to hold this data. And in fact, that&#8217;s what I would have done in the past (see<a href="http://blog.gobansaor.com/2010/03/02/excel-as-a-document-oriented-nosql-database/">Excel as a document-oriented NoSQL database</a>). Now , however, I tend to favour using a free-format (i.e. no need for a fixed database schema) structure like a JSON document, so as the source documents evolve over time (which tends to happen not just during design stages but as the system matures) this will not break older documents.</p>
<p>So, for example, original Invoice workbooks might not have a backing time-sheet while newer Invoices do. As long as new and old documents share a core sub-set of data fields they can continue to be analysed together.</p>
<p>The command takes 5 arguments and a driving table (a record so far for HAMMER commands, most have a max of two arguments). The driving table&#8217;s last column is assumed to contain the JSON document to process, columns prior to this (if any) will be output unchanged for each resulting row.</p>
<p>The first argument specifies the name of the &#8220;inner&#8221; table to fetch (if any). Most real life documents consist of header details (the &#8220;outer&#8221;document) and one or more tables (&#8220;inner&#8221; details). Invoices, time-sheets,  stock-takes, all tend to follow this pattern. This command will effectively join each document&#8217;s outer details to a single inner table (if more than 1 inner table, a call for each one is required).</p>
<p>The second (field list in SQL format) and third (<a href="http://en.wikipedia.org/wiki/Where_(SQL)#Predicates">SQL where predicate format</a>) arguments specify what inner fields to extract (if blank, then all) and what restrictions to impose (if any). So &#8220;InvNo, Date&#8221;,&#8221;InvNo &gt; 12&#8243; would only fetch documents where the InvNo &gt; 12 and only include the InvNo and Date fields.</p>
<p>The fourth and fifth arguments do the same for the outer table (i.e. Header data).</p>
<p>If any of the columns specified  (inner or outer) can not be found, or if the predicates (inner or outer) result in no selection, no error is returned, the document simply returns no rows. Likewise if an inner table is specified and no such table exists, then no rows are returned for that document &#8211; in other words this is not an outer join, which is not usually a problem as in most cases a &#8220;header&#8221; without detail lines is meaningless. If an outer join is required, then extract the headers (outers) and details (inner tables(s)) separately and join using SQL.</p>
<p>Example:</p>
<p>=HAMMER(&#8220;Select Name,FullName,Document from invoice_docs&#8221;,&#8221;SQL&#8221;,&#8221;table_2&#8243;, &#8220;[PART NUMBER],QTY&#8221;, &#8220;QTY &gt;30&#8243;, &#8220;Bin_Number&#8221;, &#8220;Bin_Number &gt; 1&#8243;, &#8220;JSONDOCVIEW&#8221;)</p>
<p>would result in:</p>
<p><a href="http://blog.gobansaor.com/2011/11/05/excel-as-a-book-of-record/jsonview/" rel="attachment wp-att-2271"><img class="aligncenter size-full wp-image-2271" title="jsonview" src="http://gobansaor.files.wordpress.com/2011/11/jsonview.png?w=500&#038;h=64" alt="" width="500" height="64" /></a></p>
<p>For more complex JSON objects use the <a href="http://blog.gobansaor.com/2011/08/14/hammer-inside/">JSON command</a> to incrementally parse the text or use the VBA JSON module within<a href="http://www.gobansaor.com/microetl"> microETL</a>. But for most situations (especially if you control the expected format) JSONDOCVIEW should handle it.</p>
<p>As JSON is fast becoming the preferred transport format for web and mobile applications having the ability to parse and produce JSON form within Excel is very useful. It is possible, for example, to use a simple web technology such as <a href="http://bit.ly/jsonwidget">http://robla.net/jsonwidget/</a> to craft another type of Really Simple System. This time with the collection happening on the web (most likely using <a href="http://aws.amazon.com/articles/1434">AWS S3 pre-signed forms</a>, so no HTML server required &#8211; keep it simple) but with the control and reporting remaining within Excel (a variation on my<a href="http://blog.gobansaor.com/2011/03/16/steam-powered-powerpivot/"> Steam Powered Server</a> idea).</p>
<p>For an example of a <a href="http://bit.ly/rss_example1">really simple system  download this</a>.</p>
<p><a href="http://blog.gobansaor.com/2011/11/22/powerpivot-vba-refesh-code-bug-fix/">Latest version of HAMMER including the above commands now released &#8230;</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gobansaor.wordpress.com/2264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gobansaor.wordpress.com/2264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gobansaor.wordpress.com/2264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gobansaor.wordpress.com/2264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gobansaor.wordpress.com/2264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gobansaor.wordpress.com/2264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gobansaor.wordpress.com/2264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gobansaor.wordpress.com/2264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gobansaor.wordpress.com/2264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gobansaor.wordpress.com/2264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gobansaor.wordpress.com/2264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gobansaor.wordpress.com/2264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gobansaor.wordpress.com/2264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gobansaor.wordpress.com/2264/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gobansaor.com&amp;blog=110633&amp;post=2264&amp;subd=gobansaor&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gobansaor.com/2011/11/05/excel-as-a-book-of-record/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<georss:point>53.204039 -6.574340</georss:point>
		<geo:lat>53.204039</geo:lat>
		<geo:long>-6.574340</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b714f82b5e24beb3b74779615b6ad969?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">gobansaor</media:title>
		</media:content>

		<media:content url="http://gobansaor.files.wordpress.com/2011/11/book_of_record.jpg" medium="image">
			<media:title type="html">book_of_record</media:title>
		</media:content>

		<media:content url="http://gobansaor.files.wordpress.com/2011/11/listoffiles.png" medium="image">
			<media:title type="html">listoffiles</media:title>
		</media:content>

		<media:content url="http://gobansaor.files.wordpress.com/2011/11/documentrow.png" medium="image">
			<media:title type="html">documentrow</media:title>
		</media:content>

		<media:content url="http://gobansaor.files.wordpress.com/2011/11/jsonview.png" medium="image">
			<media:title type="html">jsonview</media:title>
		</media:content>
	</item>
		<item>
		<title>HAMMER Alongside, as a COM Server</title>
		<link>http://blog.gobansaor.com/2011/10/07/hammer-alongside-as-a-com-server/</link>
		<comments>http://blog.gobansaor.com/2011/10/07/hammer-alongside-as-a-com-server/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 16:09:00 +0000</pubDate>
		<dc:creator>gobansaor</dc:creator>
				<category><![CDATA[ETL]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[HAMMER]]></category>
		<category><![CDATA[PowerPivot]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[.NET Com Server]]></category>
		<category><![CDATA[PowerPivot ETL]]></category>

		<guid isPermaLink="false">http://blog.gobansaor.com/?p=2242</guid>
		<description><![CDATA[Although it has always been possible to call HAMMER from within VBA via the Application.Run method, this is a somewhat clunky way of doing so and it can also be very inefficient, particularly for tight loops. But now, with this release &#8230; <a href="http://blog.gobansaor.com/2011/10/07/hammer-alongside-as-a-com-server/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gobansaor.com&amp;blog=110633&amp;post=2242&amp;subd=gobansaor&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.gobansaor.com/2011/10/07/hammer-alongside-as-a-com-server/alongside_clear/" rel="attachment wp-att-2244"><img class="alignleft size-medium wp-image-2244" title="Alongside_clear" src="http://gobansaor.files.wordpress.com/2011/10/alongside_clear.png?w=225&#038;h=300" alt="" width="225" height="300" /></a>Although it has always been <a href="http://blog.gobansaor.com/2011/07/18/vba-multithreading-net-integration-via-hammer/">possible to call HAMMER from within VBA</a> via the Application.Run method, this is a somewhat clunky way of doing so and it can also be very inefficient, particularly for tight loops. But now, with this release (V 1.2.0 (Beta) ) core functionality is exposed as a COM Server, which means easier and more efficient interfacing between VBA and the .NET multi-threaded enabled world of the datasmith&#8217;s HAMMER.</p>
<p>I call this &#8220;HAMMER Alongside&#8221;, to differentiate it from <a href="http://blog.gobansaor.com/2011/08/14/hammer-inside/">HAMMER Inside</a> where I use HAMMER internals to craft stand alone XLLs. With this COM Server method, the standard HAMMER add-in (installed or just-in-time registered) is needed alongside either a VBA add-in or a VBA enabled workbook. The extra &#8220;moving parts&#8221; are easily justified by the extra flexibility that this method allows (particularly to those with a reasonable grasp of VBA, but perhaps lacking any familiarity with the .NET world).</p>
<p>By learning a small amount of IronPython (<a href="http://www.ironpython.info/index.php/Main_Page">here&#8217;s a good starting place</a>) it&#8217;s relatively easy to hook up VBA to any .NET library through HAMMER, without having to invest time and money in learning heavy duty development environments such as Visual Studio. Using <a href="http://blog.gobansaor.com/2011/06/17/hammer-and-threads/">&#8220;Internal Threads</a>, it&#8217;s also possible to take advantage of .NETs multi-threading capability from VBA. (Note: both these options require .NET4).</p>
<p>So with VBA becoming a first-class language with regards to HAMMER, why offer Python as an alternative scripting choice? Well, one reason is to offer a means to access .NET&#8217;s power as per the last paragraph. But, the primary reason, is related to the ability of HAMMER transformations to be &#8220;detached&#8221; from Excel and run via HAMMER&#8217;s command line tools. The .NET 4 version of the command line tool supports Python, so it is possible to initially build out a micro-ETL transformation within Excel (using Python to perform the business logic alongside SQL) and then transfer that logic to the command-line tools with a minimum of modification.</p>
<p>This could be useful , for example, when a PowerPivot model moves to the server, its related HAMMER-powered micro-ETL processing could do likewise (most enterprise ETL tools support call-outs to command-line processes).</p>
<p>The <a class="zem_slink" title="Component Object Model" href="http://en.wikipedia.org/wiki/Component_Object_Model" rel="wikipedia">COM server</a> can be accessed from VBA only via late-binding like so:</p>
<p style="padding-left:30px;"><span class="Apple-style-span" style="font-size:14px;line-height:23px;">Set comServ = CreateObject(&#8220;hammerCOMServerV1&#8243;)</span></p>
<p>The server&#8217;s methods are:</p>
<ul>
<li>hammer(&#8230;) &#8211; works the same way as the UDF version.</li>
<li>hammerVersion() &#8211; returns HAMMER version, again the same as UDF version.</li>
<li>hammerVersionOK(version) &#8211; e.g.  isOK= comServ.hammerVersionOK(120) will return TRUE if the current version is &gt;= V1.2.0</li>
<li>arrayResize(anArray) enables the creation of &#8220;toFit&#8221; UDFs.</li>
<li>arrayToSheet(anArray) likewise for &#8220;toSheet&#8221; UDFs.</li>
<li>arrayToRange(anArray,pasteToWhereString)<a href="http://blog.gobansaor.com/2011/10/04/hammer-on-the-range/"> enables &#8220;toRange&#8221; UDF</a>s.</li>
<li>hammer_ppRefresh_inline(optional table,optional timeout) &#8211; refreshes a PowerPivot model, again the same as its UDF equivalent.</li>
</ul>
<p><span class="Apple-style-span" style="color:#444444;font-size:14px;line-height:23px;"><a href="http://www.gobansaor.com/microetl">Download the latest version of HAMMER from here &#8230;</a></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gobansaor.wordpress.com/2242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gobansaor.wordpress.com/2242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gobansaor.wordpress.com/2242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gobansaor.wordpress.com/2242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gobansaor.wordpress.com/2242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gobansaor.wordpress.com/2242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gobansaor.wordpress.com/2242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gobansaor.wordpress.com/2242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gobansaor.wordpress.com/2242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gobansaor.wordpress.com/2242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gobansaor.wordpress.com/2242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gobansaor.wordpress.com/2242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gobansaor.wordpress.com/2242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gobansaor.wordpress.com/2242/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gobansaor.com&amp;blog=110633&amp;post=2242&amp;subd=gobansaor&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gobansaor.com/2011/10/07/hammer-alongside-as-a-com-server/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<georss:point>53.204039 -6.574340</georss:point>
		<geo:lat>53.204039</geo:lat>
		<geo:long>-6.574340</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b714f82b5e24beb3b74779615b6ad969?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">gobansaor</media:title>
		</media:content>

		<media:content url="http://gobansaor.files.wordpress.com/2011/10/alongside_clear.png?w=225" medium="image">
			<media:title type="html">Alongside_clear</media:title>
		</media:content>
	</item>
		<item>
		<title>HAMMER on the Range</title>
		<link>http://blog.gobansaor.com/2011/10/04/hammer-on-the-range/</link>
		<comments>http://blog.gobansaor.com/2011/10/04/hammer-on-the-range/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 14:07:11 +0000</pubDate>
		<dc:creator>gobansaor</dc:creator>
				<category><![CDATA[ETL]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[HAMMER]]></category>

		<guid isPermaLink="false">http://blog.gobansaor.com/?p=2218</guid>
		<description><![CDATA[The HAMMER function is at heart an array formula. For those of you familiar with Excel array processing (likely to be a minority) this makes perfect sense, as HAMMER&#8217;s main purpose in life is to process and return tabular data, &#8230; <a href="http://blog.gobansaor.com/2011/10/04/hammer-on-the-range/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gobansaor.com&amp;blog=110633&amp;post=2218&amp;subd=gobansaor&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.gobansaor.com/2011/10/04/hammer-on-the-range/forgeontherange/" rel="attachment wp-att-2226"><img class="alignleft size-medium wp-image-2226" title="forgeontherange" src="http://gobansaor.files.wordpress.com/2011/10/forgeontherange.jpg?w=300&#038;h=176" alt="" width="300" height="176" /></a>The HAMMER function is at heart an array formula. For those of you familiar with Excel array processing (likely to be a minority) this makes perfect sense, as HAMMER&#8217;s main purpose in life is to process and return tabular data, and prior to 2007&#8242;s Excel Tables (actually 2003&#8242;s somewhat similar Lists), arrays were Excel&#8217;s only nod to the existence of tables as units of data.</p>
<p>The functionality introduced by Excel Tables is a huge improvement and if you haven&#8217;t checked it out <a href="http://www.jkp-ads.com/articles/Excel2007tables.asp">I recommend you do</a>; it and 2010&#8242;s PowerPivot are two of the most important enhancements to Excel since the PivotTable.</p>
<p>Nevertheless, if you are to write <a href="http://www.ozgrid.com/VBA/Functions.htm">UDFs</a> to handle tabular data you&#8217;re still talking arrays (although you can reference a table within a UDF, returning tabular data still requires an array). Array formulas also continue to a very powerful skill for those who wish to master Excel and a<a href="http://office.microsoft.com/en-us/excel-help/introducing-array-formulas-in-excel-HA001087290.aspx">gain if you&#8217;ve not done so, do check them out</a>. But for those of you who have an aversion to  CTRL+SHIFT+ENTER, HAMMER (and <a href="http://blog.gobansaor.com/2011/08/14/hammer-inside/">HAMMER Inside UDF</a>s) offers a number of array helper functions:</p>
<ul>
<li>HAMMERtoFit &#8211; will resize the selected destination range to fit the returned array (result remains an array). Has the disadvantage that the underlying function call will be called twice if the array area requires resizing.</li>
<li>HAMMERtoSheet &#8211; will output the array to a new sheet as a non-array table. This (and a properly sized array call to HAMMER) is the fastest method of returning variable sized datasets to Excel.</li>
<li>HAMMERtoRange &#8211; will paste the array to the range address specified (as a non-array table), will also run an optional VBA macro before/after the paste.</li>
</ul>
<p>The first two functions have been available for some time. The toRange helper is new to this release (V1.1.1). Before I describe the new function in detail, it&#8217;s useful to understand how HAMMER (and  any C based XLL ) sees and serves-back array data. An array range passed to such a function will be converted into a two dimensional multi-type array. The two types of data that will be passed over are: <a href="http://en.wikipedia.org/wiki/Double_precision_floating-point_format">Doubles </a> (all numerics and dates), and Strings (everything else). For those of you familiar with the Excel Object Model, that&#8217;s the equivalent of the VALUE2 property of the Range object. The apparent date conversion to a Double (e.g. 01-JAN-2001 passed as 36892) is, in fact, not a conversion, as dates in Excel are always simply numbers with date formatting applied.</p>
<p>Likewise,when data is returned to Excel, the data comes back in the same &#8220;raw&#8221; format, requiring date or currency formatting to be applied to the relevant cells.</p>
<p>The HAMMER function and the two helper functions toSheet and toFit operate to these conventions. The third helper function HAMMERtoRange (along with the XLRANGE set of commands) can work around this restriction (at a certain performance cost).</p>
<h3>HAMMERtoRange:</h3>
<p>The function is called in the exact same way as the parent HAMMER function but with an additional argument. This argument is a comma separated list of 1,2 or 3 elements.</p>
<p>If only one element supplied it&#8217;s assumed to be the address to paste the table to; if two elements, first is the address, 2nd is the name of a VBA macro to run after the data is pasted; if 3 elements, the 1st is a macro to run prior to the paste , 2nd is the address, and 3rd is  the post-paste macro.  Examples:</p>
<ul>
<li>=HAMMERtoRange(&#8230;,&#8221;Sheet2!a4&#8243;)</li>
<li>=HAMMERtoRange(&#8230;,&#8221;MyNamedRange&#8221;)</li>
<li>=HAMMERtoRange(&#8230;,&#8221;Sheet2!a4,myCleanupMacro&#8221;)</li>
<li>=HAMMERtoRange(&#8230;,&#8221;,Sheet2!a4,&#8221;)</li>
<li>=HAMMERtoRange(&#8230;,&#8221;mySetupMacro,Sheet2!a4,myCleanupMacro&#8221;)</li>
<li>=HAMMERtoRange(&#8230;,&#8221;onlyASetupMacro,Sheet2!a4,&#8221;)</li>
</ul>
<p>The address is specified as a &#8220;string&#8221; i.e. doesn&#8217;t reference a range object (otherwise the result would be an infinite loop). If you do mange to initiate a loop, exit it using the <a class="zem_slink" title="Esc key" href="http://en.wikipedia.org/wiki/Esc_key" rel="wikipedia">Esc key</a>, if you don&#8217;t, the loop will eventually end in one of two ways, either with a nice exception or a, not so nice, failure of Excel. The toFit helper will never loop as it is using Excel native array functionality and Excel will protect against this; the toSheet has the potential to loop but less likely than the toRange.</p>
<p>You may find the HAMMERtoRange function much slower that the other helpers (due to its dependence on COM Automation rather than the C API) but only for large datasets. Making use of the pre/post macros doesn&#8217;t require much VBA skills as the outputs of &#8220;record macro&#8221; sessions are ideal for this type of processing.</p>
<p>The address examples above,such as &#8220;Sheet1!A1&#8243;, are the &#8220;top left-hand corner&#8221; of the resulting table. The function will clear any data within the &#8220;.CurrentRegion&#8221; of that cell, but will first check if an Excel Table already occupies that region, and if so, reconstitute a table of the same name after the new dataset is pasted.</p>
<p>If a cell is sourced from a SQLite date column (actually a date &#8220;cell&#8221; <a href="http://stackoverflow.com/questions/890462/when-is-sqlites-manifest-typing-useful">as SQLite, like Excel, uses manifest typing</a>) the data will be formatted as a date (this is unlike the behaviour of toFit and toSheet). This will not normally be obvious if the source data is loaded into HAMMER via a range (see discussion above) as the data will have been delivered to SQLite as a Double. To get around this either:</p>
<ul>
<li>Update the affected column within HAMMER using the SQLiteDate function via SQL e.g. &#8220;Update table1 set datejoined = SQLiteDate(datejoined)&#8221;</li>
<li>or, use the pre/post macros to format the date columns as dates</li>
<li>or, load the dataset using these newly added COMMANDS: XLRANGE or EXCELRANGEASTEXT.</li>
</ul>
<p>XLRANGE: This command expects an address in &#8220;string&#8221; format (i.e. not a referenced range) from which it will load a table using Excel Range&#8217;s Value property. Using Value rather than Value2 means the internal function logic will know if a cell is a date or not and store that data in SQLite date format. The address can either be a &#8220;top left-hand corner&#8221; type single-cell address or a full range; if a single-cell address, then the cell&#8217;s &#8220;.CurrentRegion&#8221;  is taken to be the extent of the table to be loaded.</p>
<div>
<p>XLRANGEASTEXT: will load data using the Cell object&#8217;s Text property, so what you see is what you get. FOr example, if a cell has a percentage format, a value of 1 will be loaded as the text &#8220;100%&#8221; not as the numeric 1.</p>
<p>XLRANGEASVALUE2: is like XLRANGE but uses the .VALUE2 property i.e. simulates a &#8220;normal&#8221; range load.</p>
<p>All of these are much slower than a straight range load (ASTEXT is particularly slow). Given the potential performance hit you might well ask why offer a ASVALUE2 option (the others at least provide the potential useful service of preserving type and structure information)? The answer lies in a feature that &#8216;non-referencing string addresses&#8217; offer, i.e. changes to datasets &#8216;pointed at&#8217; by such addresses will not trigger a recalculate (as Excel is not aware of any relationship). This can be useful when building up long lists or tables for processing by HAMMER without any (potentially, long running) processing being triggered by each cell change (saves having to set the workbook to manual calculation and allows for the build out of several source tables prior to activating a re-calc).</p>
<p><a href="http://www.gobansaor.com/microetl">Download latest version of HAMMER from here:</a></p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gobansaor.wordpress.com/2218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gobansaor.wordpress.com/2218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gobansaor.wordpress.com/2218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gobansaor.wordpress.com/2218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gobansaor.wordpress.com/2218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gobansaor.wordpress.com/2218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gobansaor.wordpress.com/2218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gobansaor.wordpress.com/2218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gobansaor.wordpress.com/2218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gobansaor.wordpress.com/2218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gobansaor.wordpress.com/2218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gobansaor.wordpress.com/2218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gobansaor.wordpress.com/2218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gobansaor.wordpress.com/2218/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gobansaor.com&amp;blog=110633&amp;post=2218&amp;subd=gobansaor&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gobansaor.com/2011/10/04/hammer-on-the-range/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<georss:point>53.204039 -6.574340</georss:point>
		<geo:lat>53.204039</geo:lat>
		<geo:long>-6.574340</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b714f82b5e24beb3b74779615b6ad969?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">gobansaor</media:title>
		</media:content>

		<media:content url="http://gobansaor.files.wordpress.com/2011/10/forgeontherange.jpg?w=300" medium="image">
			<media:title type="html">forgeontherange</media:title>
		</media:content>
	</item>
		<item>
		<title>HAMMER V1 &#8211; Now with better NET 2.0 and pre-2007 Excel support</title>
		<link>http://blog.gobansaor.com/2011/09/25/hammer-v1-now-with-better-net-2-0-and-pre-2007-excel-support/</link>
		<comments>http://blog.gobansaor.com/2011/09/25/hammer-v1-now-with-better-net-2-0-and-pre-2007-excel-support/#comments</comments>
		<pubDate>Sun, 25 Sep 2011 15:25:06 +0000</pubDate>
		<dc:creator>gobansaor</dc:creator>
				<category><![CDATA[ETL]]></category>
		<category><![CDATA[HAMMER]]></category>

		<guid isPermaLink="false">http://blog.gobansaor.com/?p=2195</guid>
		<description><![CDATA[A quick post to announce V1 of HAMMER (still in Beta). The major changes are to the functionality available when NET 4.0 is not installed. The array helper functions such as HAMMERToSheet() and HAMMERToFit() now work in all versions of &#8230; <a href="http://blog.gobansaor.com/2011/09/25/hammer-v1-now-with-better-net-2-0-and-pre-2007-excel-support/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gobansaor.com&amp;blog=110633&amp;post=2195&amp;subd=gobansaor&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.gobansaor.com/2011/09/25/hammer-v1-now-with-better-net-2-0-and-pre-2007-excel-support/news/" rel="attachment wp-att-2197"><img class="alignleft size-medium wp-image-2197" title="news" src="http://gobansaor.files.wordpress.com/2011/09/news.png?w=270&#038;h=300" alt="" width="270" height="300" /></a>A quick post to announce V1 of <a href="http://www.gobansaor.com/microetl">HAMMER</a> (still in Beta).</p>
<p>The major changes are to the functionality available when NET 4.0 is not installed. The array helper functions such as HAMMERToSheet() and HAMMERToFit() now work in all versions of Excel (they were restricted to &gt;=2007 with NET 4.0).</p>
<p>So in essence there are 3 versions of the Excel Add-in:</p>
<ul>
<li>Excel 2010 64 bit, requires NET 4.0 and comes with Python and <a href="http://blog.gobansaor.com/2011/06/17/hammer-and-threads/">Internal Threads</a> support.</li>
<li>Excel 32bit (&gt;= 2000) when NET 4.0 installed; comes with Python and Internal Threads support.</li>
<li>Excel 32bit (&gt; = 2000) when NET 4.0 NOT installed; lacks Python and Internal Threads support.</li>
</ul>
<p>The SETUP.xls will detect which flavour of the add-in to install.</p>
<p>The command line version now comes in two flavours:</p>
<ul>
<li>HAMMER.exe &#8211; requires NET 4.0 to be installed; supports Python and Internal Threads.</li>
<li>HAMMER-noPython.exe &#8211; for use when NET4.0 NOT available ; as the name suggests, no Python support and also lacks Internal Threading support.</li>
</ul>
<p>There&#8217;s also a breaking change in this version:</p>
<p style="padding-left:30px;">In previous versions a horizontal single row range of cells was loaded as an &#8220;empty table&#8221; i.e. row assumed to be the &#8220;table headers&#8221;. Also, a single columned vertical range of cells was loaded as a single column table with the 1st cell as the column name. In this version, both sets of cells (horizontal or vertical ) are treated as a list and loaded into a single columned table (with a column name of &#8220;ListValues&#8221;).</p>
<p>There are also a number of new commands  :</p>
<ul>
<li>_PYSTDOUT &#8211; redirects <a href="http://diveintopython.org/scripts_and_streams/stdin_stdout_stderr.html">Pyhon&#8217;s Standard Output</a> to the specified file. Need only be set once per Excel session.</li>
<li>_PYPATHS &#8211; a comma separated list of Search Paths for Python to use to resolve import requests. Again, need only be set once.</li>
</ul>
<p><a href="http://www.gobansaor.com/hammer">Here’s a list of the HAMMER commands implemented so far (yes I know, hasn&#8217;t been kept up to date, but will still help get started)…</a></p>
<p><a href="http://bit.ly/datasmith">Download the latest version of HAMMER here …</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gobansaor.wordpress.com/2195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gobansaor.wordpress.com/2195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gobansaor.wordpress.com/2195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gobansaor.wordpress.com/2195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gobansaor.wordpress.com/2195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gobansaor.wordpress.com/2195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gobansaor.wordpress.com/2195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gobansaor.wordpress.com/2195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gobansaor.wordpress.com/2195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gobansaor.wordpress.com/2195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gobansaor.wordpress.com/2195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gobansaor.wordpress.com/2195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gobansaor.wordpress.com/2195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gobansaor.wordpress.com/2195/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gobansaor.com&amp;blog=110633&amp;post=2195&amp;subd=gobansaor&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gobansaor.com/2011/09/25/hammer-v1-now-with-better-net-2-0-and-pre-2007-excel-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>53.204039 -6.574340</georss:point>
		<geo:lat>53.204039</geo:lat>
		<geo:long>-6.574340</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b714f82b5e24beb3b74779615b6ad969?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">gobansaor</media:title>
		</media:content>

		<media:content url="http://gobansaor.files.wordpress.com/2011/09/news.png?w=270" medium="image">
			<media:title type="html">news</media:title>
		</media:content>
	</item>
		<item>
		<title>Exposing an Excel PowerPivot model as a Web Service</title>
		<link>http://blog.gobansaor.com/2011/09/21/exposing-an-excel-powerpivot-model-as-a-web-service/</link>
		<comments>http://blog.gobansaor.com/2011/09/21/exposing-an-excel-powerpivot-model-as-a-web-service/#comments</comments>
		<pubDate>Wed, 21 Sep 2011 16:30:33 +0000</pubDate>
		<dc:creator>gobansaor</dc:creator>
				<category><![CDATA[DAX]]></category>
		<category><![CDATA[Denali CTP3]]></category>
		<category><![CDATA[ETL]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[HAMMER]]></category>
		<category><![CDATA[PowerPivot]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Excel ATOM ODATA]]></category>
		<category><![CDATA[IronPython]]></category>
		<category><![CDATA[ODATA]]></category>

		<guid isPermaLink="false">http://blog.gobansaor.com/?p=2170</guid>
		<description><![CDATA[In my last post I demonstrated a simple way to interrogate an Excel based PowerPivot model using either MDX,DMV or the new DAX Query Table commands. This is a great way to dig deep into a PowerPivot model, for example, this &#8230; <a href="http://blog.gobansaor.com/2011/09/21/exposing-an-excel-powerpivot-model-as-a-web-service/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gobansaor.com&amp;blog=110633&amp;post=2170&amp;subd=gobansaor&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.gobansaor.com/2011/09/21/exposing-an-excel-powerpivot-model-as-a-web-service/pp_web_service/" rel="attachment wp-att-2175"><img class="alignleft size-medium wp-image-2175" title="pp_web_service" src="http://gobansaor.files.wordpress.com/2011/09/pp_web_service.png?w=300&#038;h=160" alt="" width="300" height="160" /></a>In my last post<a href="http://blog.gobansaor.com/2011/09/15/dax-table-queries-in-excel/"> I demonstrated a simple way to interrogate an Excel based PowerPivot model using either MDX,DMV or the new DAX Query Table commands</a>. This is a great way to dig deep into a PowerPivot model, for example, this new Denali DMV <em><strong>discover_calc_dependency</strong></em> can be use to  <a href="http://cwebbbi.wordpress.com/2011/09/17/documenting-dependencies-between-dax-calculations/">describe the dependencies between a model&#8217;s DAX measures</a>.</p>
<p>Being able to directly access the PowerPivot model opens up all sorts of interesting options, one such is a web service.</p>
<p>In the past I&#8217;ve written about exposing Excel as a simple DIY web service, see <a href="http://blog.gobansaor.com/2011/02/06/excel-as-a-diy-web-service/">here for a JavaScript example</a> and <a href="http://blog.gobansaor.com/2011/02/12/python-powered-powerpivot/">here for a Python version</a>. Both were capable of serving PowerPivot data but they both had to trigger events in Excel to do so.</p>
<p>With this newly discovered ability to query the model directly, I figured a third attempt at a PowerPivot Web Service was overdue.  This time I&#8217;m using the new kid on the block, HAMMER, and in particular using its in-built <a class="zem_slink" title="IronPython" href="http://ironpython.net/" rel="homepage">IronPython</a> interpreter.</p>
<p>I could have built a simple server using VB.NET or C# and added it as a HAMMER command, but the nature of a web service makes it hard to frame as a parametrised command. It was for this type of requirement that I added the ability to script using Python, i.e. situations where a generic command would always come up  short, for example:</p>
<ul>
<li>Should the service allow only local connections?</li>
<li>Should it use authentication, and if so, what type?</li>
<li>Should it allow free-format commands or offer only packaged commands?</li>
<li>Should it use HTTPListener (which is in-built and very powerful, but requires Admin privileges) or use a more basic socket based utility that can run without Admin privileges.</li>
<li>Should it block or handle asynchronous requests. (For services that access the Excel Object Model, it has to be blocking, but perhaps if the service simply accessed the AS engine, it night support multi-threaded queries? Must try it sometime.)</li>
</ul>
<p>For this example I decided to use <a href="http://msdn.microsoft.com/en-us/library/system.net.httplistener.aspx">HTTPListener </a>(in blocking mode and without authentication) and to expose services that accept free-format MDX,DMV or (if Denali) DAX Table Queries.</p>
<p>See the PPWebService workbook example in the latest (V0.5.0) version of HAMMER. To activate, make sure latest version of HAMMER is installed (or use activate button on Hammer sheet) and click the <em>Expose PowerPivot Model as Web Service</em> button (again on Hammer sheet). This will start a server on port 8070.</p>
<div>The service exposes 6 endpoints:</div>
<div>
<ul>
<li>/exit &#8211; this will shutdown the service.</li>
<li>/html &#8211; this will return data as a <a class="zem_slink" title="HTML element" href="http://en.wikipedia.org/wiki/HTML_element" rel="wikipedia">HTML table</a> (ideal for importing into Excel using a <a href="http://www.techrepublic.com/article/pull-data-into-microsoft-excel-with-web-queries/6115870">Web Query</a>).</li>
<li>/xml &#8211; this returns a &#8216;canonical&#8217; XML table (ideal for importing to Excel as an XML Map).</li>
<li>/json &#8211; returns a JSON table (as a list of lists).</li>
<li>/odata &#8211; returns a ATOM-base ODATA feed suitable for direct import into PowerPivot using its Data Feed import facility.</li>
<li>/csv &#8211; returns in CSV format.</li>
</ul>
<p>Each service (except /exit) expects to be followed by a MDX, DMV or DAX command. e.g. /html/evaluate(InvoiceHeaders). In the case of /csv an optional file name may be specified e.g. /csv/invhead.csv/evaluate(InvoiceHeaders).</p>
<p>It&#8217;s also possible to issue a POST request with the command in the message body.</p>
<p>As with all URL requests, the commands may need to be URL encoded (use the HAMMER command &#8220;_URLENCODE&#8221; if need be).</p>
<p><span class="Apple-style-span" style="font-size:13px;line-height:22px;"><strong>For the latest versions and articles on HAMMER follow the <a href="http://blog.gobansaor.com/category/hammer/" rel="nofollow">HAMMER tag</a> on my blog …</strong></span></p>
<div><strong><br />
</strong></div>
<div><strong><a href="http://bit.ly/datasmith" rel="nofollow">To download the latest version of HAMMER, use this link</a>.</strong></div>
<div><strong><br />
</strong></div>
<div><strong><a href="http://www.gobansaor.com/hammer" rel="nofollow">To see a list of commands implemented by HAMMER see here.</a></strong></div>
</div>
<div></div>
<div><a href='http://twitter.com/gobansaor' class='twitter-follow-button' data-text-color='#333333' data-link-color='#0060ff'>Follow @gobansaor</a></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gobansaor.wordpress.com/2170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gobansaor.wordpress.com/2170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gobansaor.wordpress.com/2170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gobansaor.wordpress.com/2170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gobansaor.wordpress.com/2170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gobansaor.wordpress.com/2170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gobansaor.wordpress.com/2170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gobansaor.wordpress.com/2170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gobansaor.wordpress.com/2170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gobansaor.wordpress.com/2170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gobansaor.wordpress.com/2170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gobansaor.wordpress.com/2170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gobansaor.wordpress.com/2170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gobansaor.wordpress.com/2170/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gobansaor.com&amp;blog=110633&amp;post=2170&amp;subd=gobansaor&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gobansaor.com/2011/09/21/exposing-an-excel-powerpivot-model-as-a-web-service/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<georss:point>53.204039 -6.574340</georss:point>
		<geo:lat>53.204039</geo:lat>
		<geo:long>-6.574340</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b714f82b5e24beb3b74779615b6ad969?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">gobansaor</media:title>
		</media:content>

		<media:content url="http://gobansaor.files.wordpress.com/2011/09/pp_web_service.png?w=300" medium="image">
			<media:title type="html">pp_web_service</media:title>
		</media:content>
	</item>
		<item>
		<title>DAX Table Queries in Excel</title>
		<link>http://blog.gobansaor.com/2011/09/15/dax-table-queries-in-excel/</link>
		<comments>http://blog.gobansaor.com/2011/09/15/dax-table-queries-in-excel/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 11:24:07 +0000</pubDate>
		<dc:creator>gobansaor</dc:creator>
				<category><![CDATA[DAX]]></category>
		<category><![CDATA[DAX v SQL]]></category>
		<category><![CDATA[Denali CTP3]]></category>
		<category><![CDATA[ETL]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[olap]]></category>
		<category><![CDATA[PowerPivot]]></category>
		<category><![CDATA[DAX Table Query]]></category>

		<guid isPermaLink="false">http://blog.gobansaor.com/?p=2144</guid>
		<description><![CDATA[Although the discovery of what Rob Collie calls a live specimen of Bigfoot itself i.e. automated refresh of PowerPivot models from VBA is indeed welcome, the activities that led to its discovery were intended to serve a different purpose, namely the use of &#8230; <a href="http://blog.gobansaor.com/2011/09/15/dax-table-queries-in-excel/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gobansaor.com&amp;blog=110633&amp;post=2144&amp;subd=gobansaor&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.gobansaor.com/2011/09/15/dax-table-queries-in-excel/dax_example_define_evaluate-2/" rel="attachment wp-att-2159"><img class="alignleft size-medium wp-image-2159" title="Dax_Example_Define_Evaluate" src="http://gobansaor.files.wordpress.com/2011/09/dax_example_define_evaluate1.png?w=300&#038;h=132" alt="" width="300" height="132" /></a>Although the discovery of what Rob Collie calls <a href="http://www.powerpivotpro.com/2011/09/powerpivot-refresh-thru-vba-at-last/">a live specimen of Bigfoot itself</a> i.e. <a href="http://blog.gobansaor.com/2011/09/09/hammering-away-at-automated-powerpivot-refresh/">automated refresh of PowerPivot models from VBA</a> is indeed welcome, the activities that led to its discovery were intended to serve a different purpose, namely the use of <a href="http://msdn.microsoft.com/en-us/library/ee634396(v=SQL.110).aspx">DAX table queries</a> in Excel.</p>
<p>Dax table queries are a new feature of DAX (part of the Denali PowerPivot upgrade) that in my opinion takes the DAX language away from its (very useful) pivot table birth-place and makes it a truly powerful alternative to SQL/MDX for analytical reporting.</p>
<p>It was <a href="http://cwebbbi.wordpress.com/category/dax/">Chris Webb&#8217;s excellent  series of articles on DAX</a> that first wetted my appetite for this feature and then hinted that it could be accessed from Excel and ultimately automated if need be.</p>
<p>An so it can, the VBA code that I used to query DMVs and send XMLA process commands to refresh the PowerPivot model can also be used for MDX and DAX tabular queries.</p>
<p>And it gets better; you don&#8217;t need to use code to do this, there&#8217;s a very simple trick which will expose this functionality in plain Excel.</p>
<p>This trick only applies to Denali as it takes advantage of one of Denali&#8217;s most welcome new features, show detail (aka drill-thru). (An alternative method which can be used in PowerPivot V1 <a href="http://cwebbbi.wordpress.com/2011/02/23/querying-powerpivot-dmvs-from-excel/">is detailed here </a> - if using V1, only DMV and MDX queries would be possible).</p>
<p>First thing to do is (in a PowerPivot Denali powered workbook) make a pivot table (doesn&#8217;t matter of what), such as this &#8230;</p>
<p><a href="http://blog.gobansaor.com/2011/09/15/dax-table-queries-in-excel/drill-thru/" rel="attachment wp-att-2145"><img class="aligncenter size-full wp-image-2145" title="drill-thru" src="http://gobansaor.files.wordpress.com/2011/09/drill-thru.png?w=500" alt=""   /></a>&#8230; then right-click and show-detail on any measure cell, which should result in a new sheet with a Excel table showing the drill-through, like so &#8230;</p>
<p><a href="http://blog.gobansaor.com/2011/09/15/dax-table-queries-in-excel/drilled/" rel="attachment wp-att-2146"><img class="aligncenter size-full wp-image-2146" title="drilled" src="http://gobansaor.files.wordpress.com/2011/09/drilled.png?w=500&#038;h=143" alt="" width="500" height="143" /></a></p>
<p>&#8230; if you then right-click, pick Tables and then Edit Query, you&#8217;ll see the MDX query associated with the table &#8230;</p>
<p><a href="http://blog.gobansaor.com/2011/09/15/dax-table-queries-in-excel/edit_connection/" rel="attachment wp-att-2147"><img class="aligncenter size-full wp-image-2147" title="edit_connection" src="http://gobansaor.files.wordpress.com/2011/09/edit_connection.png?w=500&#038;h=203" alt="" width="500" height="203" /></a></p>
<p>&#8230; you&#8217;re now free to edit this query, replacing it with whatever takes your fancy, here&#8217;s an MDX tabular query &#8230;</p>
<p><a href="http://blog.gobansaor.com/2011/09/15/dax-table-queries-in-excel/mdx_query/" rel="attachment wp-att-2148"><img class="aligncenter size-full wp-image-2148" title="mdx_query" src="http://gobansaor.files.wordpress.com/2011/09/mdx_query.png?w=500&#038;h=238" alt="" width="500" height="238" /></a></p>
<p>&#8230; you can also issue DMV queries such as &#8220;Select * from [Model].[$InvoiceHeaders]&#8221; or its equivalent DAX table query &#8230;</p>
<p><a href="http://blog.gobansaor.com/2011/09/15/dax-table-queries-in-excel/dax_example/" rel="attachment wp-att-2149"><img class="aligncenter size-full wp-image-2149" title="DAX_example" src="http://gobansaor.files.wordpress.com/2011/09/dax_example.png?w=500&#038;h=229" alt="" width="500" height="229" /></a></p>
<p>Note: both the DMV and DAX &#8216;dump a dimension&#8217; are unlikely to work for very large tables (such as a multi-million row facts) unless you have loads of free memory and the ability to use it (i.e. 64 bit), without triggering a &#8220;could not allocate memory error&#8221;.</p>
<p>DAX is not limited to DMV type queries but can be used to express very complex OLAP queries, Being able to define new  temporary just-in-time Measures (and Variables) for use within a particular queries will help not just to produce the result required, but will make DAX easier to master for newcomers.</p>
<p><del>The current version of <a href="http://www.gobansaor.com/microetl">HAMMER</a> only allows DMV and MDX queries as it restricts the &#8220;ADO&#8221; command  to &#8220;SELECT&#8221; statements; the next release will remedy that.</del></p>
<p>I&#8217;m at present working on an example of using HAMMER to build a DMV/MDX/DAX Web Service such as I did with MicroETL in P<a href="http://blog.gobansaor.com/2011/02/12/python-powered-powerpivot/">ython-Powered PowerPivot</a>. This time using IronPython and the .NET&#8217;s HttpListener and simply passing the queries straight-through to PowerPivot without any need for Excel Pivot Table involvement.  So stay tuned &#8230; Update: <a href="http://blog.gobansaor.com/2011/09/21/exposing-an-excel-powerpivot-model-as-a-web-service/">(here it is)</a></p>
<a href='http://twitter.com/gobansaor' class='twitter-follow-button' data-text-color='#333333' data-link-color='#0060ff'>Follow @gobansaor</a>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gobansaor.wordpress.com/2144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gobansaor.wordpress.com/2144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gobansaor.wordpress.com/2144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gobansaor.wordpress.com/2144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gobansaor.wordpress.com/2144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gobansaor.wordpress.com/2144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gobansaor.wordpress.com/2144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gobansaor.wordpress.com/2144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gobansaor.wordpress.com/2144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gobansaor.wordpress.com/2144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gobansaor.wordpress.com/2144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gobansaor.wordpress.com/2144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gobansaor.wordpress.com/2144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gobansaor.wordpress.com/2144/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gobansaor.com&amp;blog=110633&amp;post=2144&amp;subd=gobansaor&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gobansaor.com/2011/09/15/dax-table-queries-in-excel/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<georss:point>53.204039 -6.574340</georss:point>
		<geo:lat>53.204039</geo:lat>
		<geo:long>-6.574340</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b714f82b5e24beb3b74779615b6ad969?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">gobansaor</media:title>
		</media:content>

		<media:content url="http://gobansaor.files.wordpress.com/2011/09/dax_example_define_evaluate1.png?w=300" medium="image">
			<media:title type="html">Dax_Example_Define_Evaluate</media:title>
		</media:content>

		<media:content url="http://gobansaor.files.wordpress.com/2011/09/drill-thru.png" medium="image">
			<media:title type="html">drill-thru</media:title>
		</media:content>

		<media:content url="http://gobansaor.files.wordpress.com/2011/09/drilled.png" medium="image">
			<media:title type="html">drilled</media:title>
		</media:content>

		<media:content url="http://gobansaor.files.wordpress.com/2011/09/edit_connection.png" medium="image">
			<media:title type="html">edit_connection</media:title>
		</media:content>

		<media:content url="http://gobansaor.files.wordpress.com/2011/09/mdx_query.png" medium="image">
			<media:title type="html">mdx_query</media:title>
		</media:content>

		<media:content url="http://gobansaor.files.wordpress.com/2011/09/dax_example.png" medium="image">
			<media:title type="html">DAX_example</media:title>
		</media:content>
	</item>
		<item>
		<title>HAMMERing away at Automated PowerPivot Refresh</title>
		<link>http://blog.gobansaor.com/2011/09/09/hammering-away-at-automated-powerpivot-refresh/</link>
		<comments>http://blog.gobansaor.com/2011/09/09/hammering-away-at-automated-powerpivot-refresh/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 16:49:01 +0000</pubDate>
		<dc:creator>gobansaor</dc:creator>
				<category><![CDATA[Denali CTP3]]></category>
		<category><![CDATA[ETL]]></category>
		<category><![CDATA[HAMMER]]></category>
		<category><![CDATA[PowerPivot]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[Automate PowerPivot]]></category>
		<category><![CDATA[XMLA]]></category>

		<guid isPermaLink="false">http://blog.gobansaor.com/?p=2104</guid>
		<description><![CDATA[See below for an updated version of the VBA code that automates the refresh of PowerPivot models. Having spent the last week delving deeper into the process I&#8217;ve made a few changes. The original code doesn&#8217;t work if more than &#8230; <a href="http://blog.gobansaor.com/2011/09/09/hammering-away-at-automated-powerpivot-refresh/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gobansaor.com&amp;blog=110633&amp;post=2104&amp;subd=gobansaor&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://gobansaor.wordpress.com/2011/09/09/hammering-away-at-automated-powerpivot-refresh/code-spelunking/" rel="attachment wp-att-2106"><img class="alignleft size-medium wp-image-2106" title="Delving Deep into PowerPivot Refresh" src="http://gobansaor.files.wordpress.com/2011/09/code-spelunking.png?w=300&#038;h=233" alt="" width="300" height="233" /></a>See below for an updated version of the VBA code that automates the refresh of PowerPivot models. Having spent the last week delving deeper into the process I&#8217;ve made a few changes.</p>
<p>The original code doesn&#8217;t work if more than one PowerPivot model is opened; the new method uses a combination of DMV (tabular views of AS engine&#8217;s metadata) Sessions and Object Activity (in particular  looking for &#8216;Permissions&#8217; issued to a workbook&#8217;s sessions).</p>
<p>I&#8217;ve also allowed for a single table refresh. Again, this required some more DMV queries to determine the DimensionID associated with the table.</p>
<p>Excel linked tables can be refreshed (i.e. the <a class="zem_slink" title="XML for Analysis" href="http://en.wikipedia.org/wiki/XML_for_Analysis" rel="wikipedia">XMLA</a> will run OK) but it has no effect, as this doesn&#8217;t trigger a fetch of new data from the workbook. To automate linked table refreshes means using the dreaded SendKeys, nasty, but works after a fashion.</p>
<p>Another interesting observation, the refresh operation works fine without the PowerPivot add-in being enabled (but the associated DLLs would have been still visible and presumably used). Not sure what use that knowledge is, but interesting none the less.</p>
<p>So far so good, seems to be working; but <a href="http://blog.gobansaor.com/2011/09/01/automating-powerpivot-refresh-operation-from-vba-the-code/#comment-7316">as Marco pointed out, this is not supported </a> (but is documented and would be perfectly valid to use against a &#8216;normal&#8217; AS model). So, test, test again and make sure you have a backup of any important workbooks.</p>
<p>I&#8217;ve also managed to get the code working in VB.NET and have ported it into my <a href="http://www.gobansaor.com/microetl">HAMMER micro ETL tool</a>. In fact, having the ability to quickly and easily fetch and render DMV views using HAMMER helped enormously in identifying what DMV queries would help with the multi-model and DimensionID problems.</p>
<p>The xll (a 32bit and a 64bit version) of the next HAMMER release is included alongside the sample workbook (go to Hammer sheet and press &#8220;Enable HAMMER&#8221; button, or use the setup xls if you wish to install). You&#8217;ll need .NET 4 to run this version of HAMMER.</p>
<p>I&#8217;ve tested against Denali CPT3  (but should work with PowerPivot V1) XP SP3 32bit; 64 bit should work too (let me know if not).</p>
<p>To enable actions such as PowerPivot refreshes (which require access to the Excel Object model) I&#8217;ve made a few breaking changes and added some new commands.</p>
<ul>
<li>BREAKING CHANGE, the main HAMMER function is no longer thread enabled (accessing the Excel Object model from within a threading UDF is not to be recommended). If you&#8217;re sure you&#8217;re thread-safe use the hammerThreadEnabled function, if you don&#8217;t know what I&#8217;m talking about, don&#8217;t <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <a href="http://blog.gobansaor.com/2011/06/17/hammer-and-threads/">Internal Threads</a> are not affected by this.</li>
<li>BREAKING CHANGE, commands are now case-senstive, nothing really to do with the PowerPivot changes, just something I&#8217;ve been meaning to do for sometime.</li>
<li>PPCONNECTION (New command) &#8211; will set up an ADODB connection within HAMMER to enable ADO queries against PowerPivot DMVs. Once established can  be used by subsequent HAMMER calls.</li>
<li>ADOCONECTION (New Command) &#8211; like above but for any ADODB connection, requires a valid connection string. Also, once established, can  be used by subsequent HAMMER calls.</li>
<li>ADO (Modified Command) &#8211; can still use a connection string for once-off connections but if  an ADOCONNECTION is in force will use that instead.</li>
<li>HAMMER_ppREFRESH (New Helper function) &#8211; spawns a background thread to refresh the PowerPivot model and refresh associated pivots. Background thread may be still be running when function returns. Takes two optional arguments, table (if a single refresh is required) and timeout (in seconds, to allow for long running refresh).</li>
<li> HAMMER_ppREFRESH_inline (New Helper function) &#8211; like above but operates as a normal UDF, will not return until action is complete. In theory breaks the UDF no-side-effects rule, but appears to work fine! Also, this is the function to use if calling via VBA&#8217;s Application.Run command.</li>
<li>PPREFRESH (New command) &#8211; performs a PowerPivot model refresh but doesn&#8217;t do a connection refresh.  Main use-case is for use within VBA code to allow for finer control.</li>
</ul>
<p><a href="http://www.gobansaor.com/excel-based-bi">Download the latest Power Pivot refresh code.</a></p>
<div><strong><span style="font-size:x-small;">For the latest versions and articles on HAMMER follow the <a href="http://blog.gobansaor.com/category/hammer/" rel="nofollow">HAMMER tag</a> on my blog &#8230;</span></strong></div>
<div><span style="font-size:xx-small;"><span class="Apple-style-span" style="line-height:17px;"><strong><br />
</strong></span></span></div>
<div><span style="font-size:x-small;"><strong><a href="http://bit.ly/datasmith" rel="nofollow">To download the latest version of HAMMER, use this link</a>.</strong></span></div>
<div><span style="font-size:xx-small;"><span class="Apple-style-span" style="line-height:17px;"><strong><br />
</strong></span></span></div>
<div><span style="font-size:x-small;"><strong><a href="http://www.gobansaor.com/hammer" rel="nofollow">To see a list of commands implemented by HAMMER see here.</a></strong></span></div>
<div></div>
<div><a href='http://twitter.com/gobansaor' class='twitter-follow-button' data-text-color='#333333' data-link-color='#0060ff'>Follow @gobansaor</a></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gobansaor.wordpress.com/2104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gobansaor.wordpress.com/2104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gobansaor.wordpress.com/2104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gobansaor.wordpress.com/2104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gobansaor.wordpress.com/2104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gobansaor.wordpress.com/2104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gobansaor.wordpress.com/2104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gobansaor.wordpress.com/2104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gobansaor.wordpress.com/2104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gobansaor.wordpress.com/2104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gobansaor.wordpress.com/2104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gobansaor.wordpress.com/2104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gobansaor.wordpress.com/2104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gobansaor.wordpress.com/2104/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gobansaor.com&amp;blog=110633&amp;post=2104&amp;subd=gobansaor&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gobansaor.com/2011/09/09/hammering-away-at-automated-powerpivot-refresh/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		<georss:point>53.204039 -6.574340</georss:point>
		<geo:lat>53.204039</geo:lat>
		<geo:long>-6.574340</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b714f82b5e24beb3b74779615b6ad969?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">gobansaor</media:title>
		</media:content>

		<media:content url="http://gobansaor.files.wordpress.com/2011/09/code-spelunking.png?w=300" medium="image">
			<media:title type="html">Delving Deep into PowerPivot Refresh</media:title>
		</media:content>
	</item>
		<item>
		<title>Automating PowerPivot Refresh operation from VBA &#8211; The Code</title>
		<link>http://blog.gobansaor.com/2011/09/01/automating-powerpivot-refresh-operation-from-vba-the-code/</link>
		<comments>http://blog.gobansaor.com/2011/09/01/automating-powerpivot-refresh-operation-from-vba-the-code/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 12:59:02 +0000</pubDate>
		<dc:creator>gobansaor</dc:creator>
				<category><![CDATA[PowerPivot]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[Automate PowerPivot from VBA]]></category>
		<category><![CDATA[PowerPivot Refresh]]></category>

		<guid isPermaLink="false">http://blog.gobansaor.com/?p=2079</guid>
		<description><![CDATA[In my last post I explained how I &#8216;d managed to automate the refresh of a PowerPivot model from within VBA. The example workbook below contains the test  code I used and a PowerPivot model based on two CSV files. &#8230; <a href="http://blog.gobansaor.com/2011/09/01/automating-powerpivot-refresh-operation-from-vba-the-code/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gobansaor.com&amp;blog=110633&amp;post=2079&amp;subd=gobansaor&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://gobansaor.wordpress.com/2011/09/01/automating-powerpivot-refresh-operation-from-vba-the-code/the-code/" rel="attachment wp-att-2085"><img class="alignleft size-full wp-image-2085" title="The Code" src="http://gobansaor.files.wordpress.com/2011/09/the-code.jpg?w=500" alt=""   /></a><a href="http://blog.gobansaor.com/2011/08/31/automating-powerpivot-refresh-operation-from-vba/">In my last post I explained how I &#8216;d managed to automate the refresh of a PowerPivot model from within VBA</a>. The example workbook below contains the test  code I used and a PowerPivot model based on two CSV files.</p>
<p>To try it out you&#8217;ll need to generate the CSV files first  and then adjust the Text connections within the PowerPivot model to point at your default Excel folder (usually MyDocuments).</p>
<p>This was developed against the latest PowerPivot CTP3 release, under XP SP3</p>
<p><del>Download the example workbook from here &#8230;  </del>UPDATE: <a href="http://blog.gobansaor.com/2011/09/09/hammering-away-at-automated-powerpivot-refresh/">New version of code available here &#8230;</a></p>
<a href='http://twitter.com/gobansaor' class='twitter-follow-button' data-text-color='#333333' data-link-color='#0060ff'>Follow @gobansaor</a>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gobansaor.wordpress.com/2079/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gobansaor.wordpress.com/2079/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gobansaor.wordpress.com/2079/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gobansaor.wordpress.com/2079/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gobansaor.wordpress.com/2079/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gobansaor.wordpress.com/2079/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gobansaor.wordpress.com/2079/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gobansaor.wordpress.com/2079/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gobansaor.wordpress.com/2079/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gobansaor.wordpress.com/2079/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gobansaor.wordpress.com/2079/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gobansaor.wordpress.com/2079/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gobansaor.wordpress.com/2079/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gobansaor.wordpress.com/2079/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gobansaor.com&amp;blog=110633&amp;post=2079&amp;subd=gobansaor&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gobansaor.com/2011/09/01/automating-powerpivot-refresh-operation-from-vba-the-code/feed/</wfw:commentRss>
		<slash:comments>50</slash:comments>
		<georss:point>53.204039 -6.574340</georss:point>
		<geo:lat>53.204039</geo:lat>
		<geo:long>-6.574340</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b714f82b5e24beb3b74779615b6ad969?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">gobansaor</media:title>
		</media:content>

		<media:content url="http://gobansaor.files.wordpress.com/2011/09/the-code.jpg" medium="image">
			<media:title type="html">The Code</media:title>
		</media:content>
	</item>
	</channel>
</rss>
