<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
<title>Clearly and Simply</title>
<link>http://www.clearlyandsimply.com/clearly_and_simply/</link>
<description>Intelligent Data Analysis, Modeling, Simulation and Visualization</description>
<language>en-US</language>
<lastBuildDate>Tue, 11 Dec 2012 23:00:00 +0100</lastBuildDate>
<generator>http://www.typepad.com/</generator>

<docs>http://www.rssboard.org/rss-specification</docs>
<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ClearlyAndSimply" /><feedburner:info uri="clearlyandsimply" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license><image><link>http://creativecommons.org/licenses/by-nc-sa/3.0/</link><url>http://creativecommons.org/images/public/somerights20.gif</url><title>Some Rights Reserved</title></image><feedburner:emailServiceId>ClearlyAndSimply</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
<title>Build Network Graphs in Tableau</title>
<link>http://feedproxy.google.com/~r/ClearlyAndSimply/~3/Zg6eIT2wMpU/build-network-graphs-in-tableau.html</link>
<guid isPermaLink="false">http://www.clearlyandsimply.com/clearly_and_simply/2012/12/build-network-graphs-in-tableau.html</guid>
<description>Network Graphs in Tableau: Visualize Relationships, Connections and Associations in Networks with Tableau Software</description>
<content:encoded><![CDATA[<h3><span style="font-weight: bold;">Visualize Relationships, Connections and Associations in Networks with Tableau Software</span></h3>
<p><em><img align="left" alt="Network Graph Tableau" border="0" height="204" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee627953d970d-pi" style="background-image: none; margin: 0px 15px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; padding-top: 0px; border-width: 0px;" title="Network Graph Tableau" width="260" /><a href="http://www.clearlyandsimply.com" title="Clearly and Simply">Clearly and Simply</a> proudly presents a new guest article: Michael Martin of </em><a href="http://www.informationarts.ca/" title="Business Information Arts">Business Information Arts</a><em></em><em>, Tableau Partner, Tableau Certified Consultant and leader of the Toronto Tableau User Group shows us how to visualize Network Graphs using <a href="http://www.tableausoftware.com" title="Tableau Software">Tableau Software</a>. Enjoy.</em></p>
<p>Network Graphs can help us see and measure relationships and connections between people, places, and things over time. This can be expressed as identifying, measuring and understanding process flows, the mix of products in shopping carts, social network and email traffic, affinities and interests people share (or don’t share), and the “hierarchies of influence” in business and / or social systems by identifying who or what triggers events, and the impacts they have on others.</p>
<p>Today’s post describes how you can build Network Graphs using <a href="http://www.tableausoftware.com" title="Tableau Software">Tableau Software</a> versions 6 or 7, including a detailed how-to tutorial and some information on the background of Network Theory.</p>

<h4><span style="font-weight: bold;">What is a Network Graph? A Picture says more than 1,000 words</span></h4>
<p>What are Network Graphs for? Here are just a few practical examples:</p>
<p><strong>Contacts Between Philanthropic Twitter Users</strong></p>
<p><strong><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c34841ae5970b-pi"><img alt="Contacts Between Philanthropic Twitter Users - click to enlarge" border="0" height="280" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c34841af9970b-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Contacts Between Philanthropic Twitter Users - click to enlarge" width="520" /></a></strong></p>
<p><strong>The Organization of Hierarchical Communities</strong></p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee6279598970d-pi"><img alt="The Organization of Hierarchical Communities - click to enlarge" border="0" height="349" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee62795ae970d-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="The Organization of Hierarchical Communities - click to enlarge" width="520" /></a><strong>The Path to Products People Buy</strong></p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee62795c3970d-pi"><img alt="The Path to Products People Buy - click to enlarge" border="0" height="449" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c34841b69970b-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="The Path to Products People Buy - click to enlarge" width="520" /></a>Last, but not least a Network Graph built in <a href="http://www.tableausoftware.com" title="Tableau Software">Tableau</a>:</p>
<p><strong>Association of Food Groups, Brands and Flavor</strong><strong>s</strong></p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee6279616970d-pi"><img alt="Association of Food Groups, Brands and Flavors - click to enlarge" border="0" height="308" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee627962e970d-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Association of Food Groups, Brands and Flavors - click to enlarge" width="520" /></a><span style="font-weight: bold;">Tableau’s Out of the Box Network Graphs</span></p>
<p><a href="http://www.tableausoftware.com/" title="Tableau Desktop">Tableau Desktop</a> is one of my favorite data analysis and reporting tools. Other excellent products such as <a href="http://www.visokio.com/omniscope" target="_self" title="Visokio Omniscope">Visokio Omniscope</a> support network graphs as one of a wide number of supported view types. But what I have always found so impressive about how Tableau is engineered is how various “loosely coupled” features can be re-assembled to create new ones. Examples of this include double axis graphs, bullet charts, and the support for bubble graphs and tree maps in the upcoming Tableau 8 release (Q1 of 2013). Tableau is a fabulous “Swiss Army Knife” for visualizing data.</p>
<h4><span style="font-weight: bold;">Build Network Graphs with Tableau – The How to</span></h4>
<p>My implementation of network graphs in Tableau leverages features that have been around since version 1, the circle and the line mark types, and support for scatter plots – and ability to draw double axis graphs (hackable for years before being officially supported as “combo charts” in version 6). With a little bit of data preparation, this is all you need to draw a network graph in Tableau. </p>
<p>For me, the fun really starts when other great Tableau functionalities (actions, parameters, page field animation, filtering, highlighting, size by, color by, table calculations to name just a few) are brought into play.</p>
<p><strong>Data Preparation</strong></p>
<p>Key to my implementation is data preparation given the requirement to connect elements in the form of a transaction and lay out the design of the network graph in the Tableau view:</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c34841bd9970b-pi"><img alt="Data Preparation - click to enlarge" border="0" height="214" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c34841bf0970b-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Data Preparation - click to enlarge" width="520" /></a>If you want to follow the step-by-step below using my example data, here is the Excel workbook with the data for free download:</p>
<p style="text-align: center;"><a href="http://www.clearlyandsimply.com/files/2012/12/network_graphs_example_data.xlsx" title="Download Network Graphs Example Data (Microsoft Excel 2007/2010, 14.3K)">Download Network Graphs Example Data (Microsoft Excel 2007/2010, 14.3K)</a></p>
<p><strong>Demo – A simple Network Graph</strong></p>
<p>Here’s a simple network graph based on the example data. </p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c34841c0b970b-pi"><img alt="Simple Network Graph - click to enlarge" border="0" height="382" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3eb326e5970c-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Simple Network Graph - click to enlarge" width="520" /></a><strong>The Step-by-Step Tutorial</strong></p>
<p><strong>Step 1 – The Basic Set Up</strong></p>
<p>To get started, put the “Line Y” field to the Row Shelf and “Line X” field on the Column shelf. Tableau will automatically set the mark type to circle and render a basic scatterplot. The “Line Y” and “Line X” co-ordinates in the source data are visible via the field value headers.</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3eb326fc970c-pi"><img alt="Step 1 – The Basic Set Up - click to enlarge" border="0" height="455" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee627969e970d-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Step 1 – The Basic Set Up - click to enlarge" width="520" /></a><strong>Step 2 – Dual Axis</strong></p>
<p>Add the “Circle Y” to View on the <strong>rows shelf </strong>as a double axis, and synchronize the two Y axes (right click on the axis, and click on “Synchronize axis”).</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3eb32726970c-pi"><img alt="Step 2 – Dual Axis - click to enlarge" border="0" height="393" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee62796ca970d-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Step 2 – Dual Axis - click to enlarge" width="520" /></a><strong>Step 3 – Multiple Mark Types</strong></p>
<p>The next step is to format the Tableau Marks Card to show &quot;Multiple Mark Types“. Then cycle to the &quot;Circle Y” mark and set mark type as &quot;Pie“. Drag the &quot;Node Name&quot; field to the Label Pill. You can optionally color the “Node Name” field by ID by dragging ID to Level of Detail Shelf Resize the Pie mark to make larger – each pie slice represents a Transaction ID.</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3eb32757970c-pi"><img alt="Step 3 – Multiple Mark Types - click to enlarge" border="0" height="455" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee6279704970d-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Step 3 – Multiple Mark Types - click to enlarge" width="520" /></a><strong>Step 4 – Connect the Dots</strong></p>
<p>Then cycle to the &quot;Line Y&quot; Mark. Drag the “ID” and “Relationship” fields to Level of Detail shelf. Set the mark type to “Line”. Tableau will connect the dots – and you have a simple Network Graph. Resize the Line Y series to make lines thinner and color the lines as desired.</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c34841cbd970b-pi"><img alt="Step 4 – Connect the Dots - click to enlarge" border="0" height="455" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee6279740970d-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Step 4 – Connect the Dots - click to enlarge" width="520" /></a>Optionally, you can format the canvas to include grid lines and turn brushing on in the Color Legend. Uncheck the “Show Header” in the “Line X”, “Line Y”, and “Circle Y” fields in the row and column shelves. </p>
<p><strong>Step 5 – The Tooltips</strong></p>
<p>If you hover over nodes in the view with the mouse, you’ll see Tableau generated tooltip text:</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3eb327a7970c-pi"><img alt="Step 5 – The Tooltips - click to enlarge" border="0" height="482" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee6279762970d-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Step 5 – The Tooltips - click to enlarge" width="520" /></a>We can do a few things to make the Tooltips more meaningful. With the “Line Y” Mark selected in the Marks Card, place the “Relationship” and “Sales vs Sales For Display” fields in the Level of Detail Shelf. </p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3eb327e8970c-pi"><img alt="Step 5 - Level of Detail on different Marks - click to enlarge" border="0" height="491" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3eb327fc970c-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Step 5 - Level of Detail on different Marks - click to enlarge" width="320" /></a>The “Sales For Display” field is a calculated field that I will describe shortly.</p>
<p>Then cycle to the “Circle Y” field in the Marks Card and place the “Total Sales”, “InDegree”, “OutDegree”, “Node Name”, and “ID” fields in the Level of Detail Shelf.</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee62797e4970d-pi"><img alt="Step 5 - Improved Tooltips - click to enlarge" border="0" height="251" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee62797fa970d-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Step 5 - Improved Tooltips - click to enlarge" width="520" /></a><strong>Step 6 – Calculated Fields and the Tooltips again</strong></p>
<p>The next step is to define a simple calculation which I named “Sales vs Sales For Display” in my workbook:</p>
<p><em>IF Sum([Sales])=0 THEN Sum([Sales For Display]) ELSE Sum([Sales]) END</em></p>
<p>The output of this calculation is the value of either the “Sales” or the “Sales For Display” data fields associated with a single transaction. My implementation needs this calculation because without this calculation the value of the “Sales” field will change to zero (or change from zero to the value of the sale) as you pass the halfway point between two connected nodes when traversing the line between connected nodes with the mouse.</p>
<p>If you take another look at the source data, you’ll see that the value of the “Sales For Display” field is the same as the value for “Sales” in the previous row for a given transaction ID. As Tableau aggregates the “Sales” and “Sales For Display” metrics by Transaction ID, the value of the calculation will change as you pass the halfway point in the line connecting the nodes in the transaction with the mouse.</p>
<p>Then edit the tooltip text is shown in the figure below. </p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c34841d81970b-pi"><img alt="Step 6 – Calculated Fields and the Tooltips again - click to enlarge" border="0" height="282" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3eb3287c970c-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Step 6 – Calculated Fields and the Tooltips again - click to enlarge" width="520" /></a>The first two lines will appear when the mouse hovers over a line connecting two nodes (the “Line Y” field). The remaining four lines will display when the mouse hovers over a Node (the “Circle Y” field).</p>
<p><strong>Step 7 (optional) – A Summary Table</strong></p>
<p>You can optionally make a summary sales table that sums the “Sales” field by the “Node Name” field which includes creating a calculation named “Sales Label” that suppresses the display of zero values in the “Sales Field”.</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c34841daf970b-pi"><img alt="Step 7 (optional) – A Summary Table - click to enlarge" border="0" height="447" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee627984d970d-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Step 7 (optional) – A Summary Table - click to enlarge" width="520" /></a>If you look at the source data, you’ll see that the “Relationship” field is encoded to show who the seller and buyer were. The value Ken à Bill describes a transaction where Ken was the seller and Bill was the buyer. Ken is listed as the “Initiating Person” and Bill is listed as the “Secondary Person”. The “Direction” field explains this in another way; from Ken’s point of view as the “Initiating Person”, this is an “Out Degree” connection. From Bill’s point of view as the buyer, this is an “In Degree” connection.</p>
<p><strong>Step 8 (optional) – Filter Actions</strong></p>
<p>You can optionally define a Tableau Filter Action to filter data that will appear in the “Summary Sales Table” based in which transactions in the view are selected with the mouse. In my implementation, the Action is set to run “On Select” based on the values of the “ID” and “Node Name” data fields.</p>
<p>For more information on how to use Actions in Tableau, have a look at this how-to tutorial: <a href="http://www.clearlyandsimply.com/clearly_and_simply/2010/08/the-power-of-tableau-actions.html" title="The Powe of Tableau Actions">The Power of Tableau Actions</a>.</p>
<p><strong>Step 9 (optional) – Animated View</strong></p>
<p>You can optionally animate the view by dropping the “ID” field into the Pages Shelf and inserting the Pages Shelf into the Dashboard by selecting “Current Page”.</p>
<p>After you start the Page Player, transactions will come into the view sorted by the Transaction ID number. With the use of calculations and “Page History” settings, you can create very interesting animated views of transaction oriented data.</p>
<h4><strong>The Result</strong></h4>
<p>Here is the example packaged Tableau workbook for free 
download:</p>
<p style="text-align: center;"><a href="http://www.clearlyandsimply.com/files/2012/12/prototype_scene_graph.twbx" title="Download Prototype Scene Graph (Tableau 7 Packaged Workbook, 62.3K)">Download 
Prototype Scene Graph (Tableau 7 Packaged Workbook, 62.3K)</a></p>
<h4><span style="font-weight: bold;"><span style="font-weight: bold;">Network Metrics</span></span></h4>
<p>The <strong>“Network Density”</strong> metric is commonly calculated as the number of actual possible connections divided by the number of possible connections. There are 9 actual connections and 56 possible connections in the example data, resulting in a Network Density value of .1607 which depending on the context could be considered to be low or high. </p>
<p>The <strong>“Network Centralization”</strong> metric tells us how “centered” the network is around the member(s) of the network with the highest number of connections. In a network with three members, this metric is of little value – but in a network with thousands or millions of connections, knowing the people or persons the network is centralized around is meaningful to our understanding of the network. In the data driving my implementation, Jane is involved in four of the nine transactions which would be commonly calculated as (4 / 9) = .444. This would be considered a high value in most cases, so you could say that the total network is highly centralized (around Jane).</p>
<p>The <strong>“Network Homophily”</strong> metric describes the degree that connected nodes share similar characteristics - i.e. are connected nodes largely alike? The richer the source data is, the more important and interesting this metric can be as the row count increases. This metric is of particular interest to marketers.</p>
<p>Switching to Node specific metrics; the <strong>“In Degree”</strong> metric is the count of in-coming connections to a Node from other nodes in the network. The “Out Degree” metric is the count of outgoing connections from a single node to other nodes in the network. These two metrics are often used to help analysts and marketers understand how “social” products within particular retail categories are with products in similar or different retail categories.</p>
<p>The <strong>“Betweeness”</strong> metric helps us understand how important a particular node is to the overall “performance” of the network from the perspective of a particular metric or class of metrics. The example data describes connections through “Sales”. If Sally and Roger had made huge sales to each other or to Jane, removing Jane from the network would lower the “total value” of the network because Roger and Sally are in the network by virtue of their relationships to Jane.</p>
<p>The <strong>“Closeness”</strong> metric helps us understand how useful a given network member is for getting a message from outside the network circulated within the network as soon as possible. If an outside person wanted to circulate a message within the network described in the example data, the go-to person is Jane because she is directly connected (one hop away) to five other network members, who in turn are a hop away from the remaining network members (Roger and Ken). </p>
<p>Although the “Betweenness” and “Closeness” metrics are important, they don’t necessarily predict the ranking of members in a network by the governing metric (in this example, sales). The top seller in the network is Wayne by virtue of a 20k sale to Marjory. If you size the “Node ID” field by “Sales”, you would immediately realize how important Wayne is to the network from a sales performance point of view.</p>
<p>The <strong>“Eigenvector Centrality”</strong> metric explains the degree to which a given node is connected to the most important node in the network. In a given network, an “introverted” member with low “in degree” and “out degree” metrics and has little or no “betweenness” or “closeness” could in fact be quite important due to its influence on members who are very well connected. If Jane is heavily influenced by Sally’s purchasing recommendations, Sally’s role in shaping the profile of the network is important given Jane’s position in the network as the most important buyer in the network.</p>
<h4><span style="font-weight: bold;">Recommended Further Resources</span></h4>
<p>There are many great resources on and off the web for learning about network theory and metrics. Here are a few that I’ve found helpful, with apologies to other great resources that I haven’t encountered yet.</p>
<p><a href="http://www.cs.umd.edu/hcil/research/visualization.shtml" target="_self" title="University of Maryland Human / Computer Interaction Lab">University of Maryland Human / Computer Interaction Lab</a> contains links to many interesting data visualization projects and white papers related to network data visualizations.</p>
<p><a href="http://www.codeplex.com/nodexl" target="_self" title="Node XL">Node XL</a> is an Excel add-in for visualizing network graphs.</p>
<p><a href="http://www.amazon.com/Analyzing-Social-Media-Networks-NodeXL/dp/0123822297/ref=sr_1_1?ie=UTF8&amp;qid=1354997406&amp;sr=8-1&amp;keywords=Analyzing+Social+Media+Networks+With+NodeXL" title="Analyzing Social Media Networks With NodeXL">Analyzing Social Media Networks With NodeXL</a> by Derek Hansen, Ben Schneiderman and Mark Smith, published by Morgan Kaufman.</p>
<p title="Gephi"><a href="http://www.gephi.org" target="_self" title="Gephi">Gephi</a> is an open source tool for visualizing network graphs.</p>
<p><a href="http://www.aaronkoblin.com/work/flightpatterns/index.html" title="Aaron Koblin - Flight Patterns">Aaron Koblin</a> provides a great visualization of airline flight patterns over North America.</p>
<h4><span style="font-weight: bold;">About Michael</span></h4>
<p>Michael Martin (<a href="mailto:michael@informationarts.ca" title="Email Michael Martin)">email Michael</a>) works internationally in a variety of business sectors that include market research, consumer packaged goods and retail, banking, hospitality, commercial construction, entertainment, governmental, and non-profit.</p>
<p>His project deliverables include business performance forecasts, strategic and operational case study white papers, operational dashboards and scorecards, associative and neural networks, customer / product segmentation and market-basket analyses.</p>
<p>Michael is a Tableau Partner, a Certified Tableau Consultant and leads the Tableau Toronto User Group. </p>
<h4><span style="font-weight: bold;"><em>Robert’s Note</em></span></h4>
<p><em>A big time thank you very much to Michael for contributing this fantastic article. If you enjoyed what you have read, please drop Michael a line to say thank you by email (email link see above) or leave him a comment here. </em></p>
<p>Stay tuned.</p><img src="http://feeds.feedburner.com/~r/ClearlyAndSimply/~4/Zg6eIT2wMpU" height="1" width="1"/>]]></content:encoded>


<category>Tableau</category>
<category>Visualization</category>

<dc:creator>Robert</dc:creator>
<pubDate>Tue, 11 Dec 2012 23:00:00 +0100</pubDate>

<feedburner:origLink>http://www.clearlyandsimply.com/clearly_and_simply/2012/12/build-network-graphs-in-tableau.html</feedburner:origLink></item>
<item>
<title>Create Excel Choropleth Maps from Shape Files</title>
<link>http://feedproxy.google.com/~r/ClearlyAndSimply/~3/NbrCt1qjIXM/create-excel-choropleth-maps-from-shape-files.html</link>
<guid isPermaLink="false">http://www.clearlyandsimply.com/clearly_and_simply/2012/12/create-excel-choropleth-maps-from-shape-files.html</guid>
<description>How to transform Shape Files into Microsoft Excel Choropleth Maps – including 2 Maps of Germany by Zip Codes</description>
<content:encoded><![CDATA[<h3><span style="font-weight: bold">How to transform Shape Files into Microsoft Excel Choropleth Maps – including 2 Maps of Germany by Zip Codes</span></h3>  <p><img align="left" alt="Germany by Zip Codes" border="0" height="260" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee62ee706970d-pi" style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 15px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top: 0px; border-right: 0px; padding-top: 0px" title="Germany by Zip Codes" width="248" />On several occasions I thought (and stated) that I already published everything I have to say about Choropleth Maps with Excel. </p>  <p>Having said that, it seems as if <em>“the ghosts I called I can’t get rid of now”</em>. Recently someone asked me if I could provide an Excel Choropleth Map of Germany by zip codes. Careless and stupid boy I am, I answered “sure this is no problem”. What a misjudgment. </p>  <p>If you followed my previous <a href="http://www.clearlyandsimply.com/clearly_and_simply/choropleth-maps/" title="Excel Choropleth Map articles">Excel Choropleth Map articles</a>, you know that it takes either an Enhanced Metafile of the map you can ungroup in Excel to get the shapes or at least an SVG file to transform it to an EMF file using e.g. <a href="http://inkscape.org/" title="Inkscape">Inkscape</a>.&#0160; </p>  <p>And here is the roadblock I encountered: I simply couldn’t find a map of Germany by zip codes in one of the required formats. All I could find were ESRI shape files. After hours of searching for EMF and SVG files, I gave up, simply reversed my thinking and looked for a tool to convert shape files into SVG. 5 minutes later I had the solution. </p>  <p>Today’s post describes how to use <a href="http://indiemapper.com/" title="Indiemapper">Indiemapper</a>, a free online tool, to transform shape files into SVG which can then be used for Microsoft Excel Choropleth Maps in the well-known way.</p>    <h4><span style="font-weight: bold">The Challenge</span></h4>  <p>The Choropleth Map approach I used in all articles here requires ungrouped shapes in Excel. The easiest way of getting there is an EMF file you simply import into Excel and ungroup it until you have one shape for each region you want to visualize. If you don’t have an EMF file, <a href="http://www.clearlyandsimply.com/clearly_and_simply/2009/08/build-your-own-choropleth-maps-with-excel.html" title="Build your own Choropleth Maps with Excel">this article</a> shows you how to transform an SVG file into EMF format.</p>  <p>But what if you can find the map you need neither in EMF nor in SVG format. <a href="http://www.gadm.org/country">Global Administrative Areas</a>, for one, provides the administrative regions of all countries of the world. The problem: they are ESRI shapes files, not EMF or SVG.</p>  <p>Today’s challenge is to find an easy way of transforming ESRI shape files into EMF which can be directly used in Excel for creating Choropleth Maps. </p>  <h4><span style="font-weight: bold">The Solution - Indiemapper</span></h4>  <p><a href="http://indiemapper.com/" title="Indiemapper">Indiemapper</a> is a free service provided by <a href="http://www.axismaps.com/" title="Axis Maps">Axis Maps</a> making static, thematic maps from geographic data. It also as an export feature to transfer shape files into SVG, JPG and PNG.</p>  <p><a href="http://www.indiemapper.com" title="Indiemapper"><img alt="Indiemapper" border="0" height="308" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee617a698970d-pi" style="background-image: none; border-right-width: 0px; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Indiemapper" width="520" /></a><strong>Step 1: Load your Shape Files</strong></p>  <p>After launching Indiemapper, click on Shapefile and browse for the file on your computer.</p>  <p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3ea30f01970c-pi"><img alt="Browse for Shape File - click to enlarge" border="0" height="216" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3ea30f12970c-pi" style="background-image: none; border-right-width: 0px; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Browse for Shape File - click to enlarge" width="320" /></a>If available, also upload the .dbf file in the following dialogue.</p>  <p><strong>Step 2: Skip New Layer Option</strong></p>  <p>Skip the next dialogue window to add a new layer by clicking on Cancel:</p>  <p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee617a6df970d-pi"><img alt="Skip New Layer Option - click to enlarge" border="0" height="303" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3ea30f41970c-pi" style="background-image: none; border-right-width: 0px; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Skip New Layer Option - click to enlarge" width="520" /></a><strong>Step 3: Turn off the Graticule</strong></p>  <p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3ea30f55970c-pi"><img alt="Graticule - click to enlarge" border="0" height="386" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c34743607970b-pi" style="background-image: none; border-right-width: 0px; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Graticule - click to enlarge" width="200" /></a></p>  <p>If necessary (like it was in my case), uncheck the strokes checkbox in the Graticule window.</p>  <p><strong>Step 4: Export</strong>&#0160;</p>  <p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c34743649970b-pi"><img alt="Export - click to enlarge" border="0" height="303" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3ea30fcd970c-pi" style="background-image: none; border-right-width: 0px; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Export - click to enlarge" width="520" /></a></p>  <p>Click on export at the top right of the website, choose “layered SVG”, select a filename and click on Generate File:</p>  <p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee617a77b970d-pi"><img alt="Generate File - click to enlarge" border="0" height="283" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c34743674970b-pi" style="background-image: none; border-right-width: 0px; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Generate File - click to enlarge" width="200" /></a></p>  <p>Finally export the generated SVG file to your computer:</p>  <p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee617a79a970d-pi"><img alt="Export File - click to enlarge" border="0" height="283" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3ea30ff6970c-pi" style="background-image: none; border-right-width: 0px; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Export File - click to enlarge" width="200" /></a></p>  <p>That’s it. In 4 simple steps we transformed an ESRI Shape File into SVG, i.e. the file format we can now transform into an EMF file and prepare it for being used as a Choropleth Map in Excel, exactly the way I already described it here: <a href="http://www.clearlyandsimply.com/clearly_and_simply/2009/08/build-your-own-choropleth-maps-with-excel.html" title="Build your own Choropleth Maps with Excel">Build your own Choropleth Maps with Excel</a>.</p>  <h4><span style="font-weight: bold">The Show Case – Germany by Zip Codes</span></h4>  <p>With the few steps described above combined with the technique to transform SVG files into Excel Choropleth Maps (<a href="http://www.clearlyandsimply.com/clearly_and_simply/2009/08/build-your-own-choropleth-maps-with-excel.html" title="Build your own Choropleth Maps with Excel">here</a>), I was able to produce the following 2 maps of Germany by zip codes in almost no time.</p>  <p>For your understanding: German zip codes have 5 digits and there are more than 8,200 of them (only the ones which represent a geographical region). Very often, geographical visualizations use only the first 2 digits of the zip code, dividing Germany into 95 regions. 95? Shouldn’t that be 99? No. the remaining 4 are unused or do not represent a geographical area.</p>  <p>So, here is a map of Germany by zip code 2 (what we call PLZ 2):</p>  <p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee617a7ce970d-pi"><img alt="Germany by Zip Code 2 - click to enlarge" border="0" height="591" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c347436e9970b-pi" style="background-image: none; border-right-width: 0px; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Germany by Zip Code 2 - click to enlarge" width="520" /></a>And here is the comprehensive one: Germany by zip code 5 (PLZ 5) with more than 8,200 shapes:</p>  <p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee62ee7a2970d-pi"><img alt="Germany by Zip Code 5 - click to enlarge" border="0" height="620" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee62ee800970d-pi" style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top: 0px; border-right: 0px; padding-top: 0px" title="Germany by Zip Code 5 - click to enlarge" width="520" /></a></p>  <p><span style="font-weight: bold">The Disadvantages</span></p>  <p>Let’s call a spade a spade: using Choropleth Maps in Microsoft Excel is nothing else than the poor man’s geographical visualization tool. It takes some time and know-how to set them up and they come with a couple of disadvantages. </p>  <p>The zip code 2 map with 95 shapes works pretty well. With the zip code 5 map, however, the technique is definitely reaching its limits:</p>  <ul></ul>  <ul></ul>  <ul>   <li>More than 8,200 shapes bloat the file size to almost 9 MB </li>    <li>Although I used the optimized VBA code provided <a href="http://www.clearlyandsimply.com/clearly_and_simply/2012/09/faster-choropleth-maps-with-microsoft-excel.html" title="Faster Choropleth Maps with Microsoft Excel">here</a>, the map takes around 10 seconds to update on my machine. Everything else than a good performance and user experience </li> </ul>  <ul></ul>  <p>Still, if you do not have a professional geographical visualization tool available, Microsoft Excel can be a reasonable workaround, even for a very detailed map like Germany by zip codes.</p>  <h4><span style="font-weight: bold">The Download Links</span></h4>  <p>Germany by zip code 2 (PLZ 2):</p>  <p style="text-align: center"><a href="http://www.clearlyandsimply.com/files/2012/12/choropleth_map_germany_by_zip_code_2.xlsm" title="Download Choropleth Map Germany by Zip Code 2 (Microsoft Excel 2007/2010, 965.7K)">Download Choropleth Map Germany by Zip Code 2 (Microsoft Excel 2007/2010, 965.7K)</a></p>  <p>Germany by zip code 5 (PLZ 5):</p>  <p style="text-align: center"><a href="http://www.clearlyandsimply.com/files/2012/12/choropleth_map_germany_by_zip_code_5.xlsm" title="Download Choropleth Map Germany by Zip Code 5 (Microsoft Excel 2007/2010, 8910.4K)">Download Choropleth Map Germany by Zip Code 5 (Microsoft Excel 2007/2010, 8910.4K)</a></p>  <p>The data used in these example workbooks is made up. </p>  <h4><span style="font-weight: bold">Acknowledgements</span></h4>  <p>Many thanks go to the developers of <a href="http://indiemapper.com/" title="Indiemapper">Indiemapper</a>, Zachary Johnson, Andy Woodruff, Dave Heyman, Ben Sheesley and Mark Harrower for creating this great online tool and to <a href="http://www.axismaps.com/" title="Axis Maps">Axis Maps</a> for providing it for free. Thank you!</p>  <p>Stay tuned.</p><img src="http://feeds.feedburner.com/~r/ClearlyAndSimply/~4/NbrCt1qjIXM" height="1" width="1"/>]]></content:encoded>


<category>Choropleth Maps</category>
<category>Microsoft Excel</category>
<category>Visualization</category>

<dc:creator>Robert</dc:creator>
<pubDate>Sun, 09 Dec 2012 22:00:00 +0100</pubDate>

<feedburner:origLink>http://www.clearlyandsimply.com/clearly_and_simply/2012/12/create-excel-choropleth-maps-from-shape-files.html</feedburner:origLink></item>
<item>
<title>Interactive Tooltip Examples</title>
<link>http://feedproxy.google.com/~r/ClearlyAndSimply/~3/IUx3qOBNVfo/interactive-tooltip-examples.html</link>
<guid isPermaLink="false">http://www.clearlyandsimply.com/clearly_and_simply/2012/11/interactive-tooltip-examples.html</guid>
<description>3 Examples of how to use an ActiveX Spreadsheet Control as a Tooltip on a Microsoft Excel Worksheet</description>
<content:encoded><![CDATA[<h3><span style="font-weight: bold;">3 Examples of how to use an ActiveX Spreadsheet Control as a Tooltip on a Microsoft Excel Worksheet</span></h3>
<p><a href="http://www.flickr.com/photos/pradovit/2554979119/" title="Prova Riporti - Photographer il Vanzo - tiny little pieces (flickr.com)"><img align="left" alt="Prova Riporti - Photographer il Vanzo - tiny little pieces (flickr.com)" border="0" height="260" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d85dbe7970c-pi" style="background-image: none; margin: 0px 15px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; padding-top: 0px; border: 0px;" title="Prova Riporti - Photographer il Vanzo - tiny little pieces (flickr.com)" width="200" /></a>The <a href="http://www.clearlyandsimply.com/clearly_and_simply/2012/11/interactive-tooltips-on-excel-worksheets.html" title="Interactive Tooltips on Excel Worksheets">recent post</a> described how to use an ActiveX Spreadsheet Control as a tooltip on Excel worksheets. At first sight this seemed to be a nifty little idea to spice up tooltips on Microsoft Excel worksheets. In the meantime, however, I had to learn that there is a major pitfall:</p>
<p>The heart of the solution, the ActiveX Spreadsheet Control is part of the so called Office Web Components. So far, so good. The problem is that Microsoft does not ship the Office Web Components with Office 2007 and later anymore. In other words, in a clean, new Office 2007/2010 installation, the ActiveX Spreadsheet Control is not available anymore.</p>
<p>Microsoft still provides the Office Web Components for free download (<a href="http://www.microsoft.com/en-us/download/details.aspx?id=22276">Office 2003 Add-in: Office Web Components</a>), but there is still a major drawback: if you want to use the described technique, you have to make sure that every user of your workbook either uses Excel 2003 or has the Office Web Components installed.</p>
<p>At the end of the previous post I announced a follow up article with more practical examples using the technique. Knowing now what I didn’t know before, I pondered if this article would still make sense. To cut a long story short, I finally decided to publish it despite the limitation described above. Maybe some of you will still find it interesting and useful.</p>
<p>Today’s post provides 3 different use cases of how to take advantage of the ActiveX Spreadsheet Control in a tooltip:</p>
<ul>
<li>a scrollable tooltip</li>
<li>side calculations within a tooltip</li>
<li>an improved version of the Summary Card tooltip</li>
</ul>
<p>As always the articles provides all Excel workbooks for free download.</p>

<h4><span style="font-weight: bold;">Example 1 – Details on the selected cell or row in a scrollable list</span></h4>
<p>Let’s assume we have an Excel workbook with unemployment rates from 2008 to 2012 by state on the first worksheet and by county on the second sheet. An ActiveX Spreadsheet Control can provide the county details for the active row (i.e. the selected state) in a scrollable tooltip: </p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d85dbf7970c-pi"><img alt="County Details - click to enlarge" border="0" height="420" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee4fb02a7970d-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="County Details - click to enlarge" width="520" /></a></p>
<p>The technique for setting up the Spreadsheet Control is exactly the same as described in the how-to post: <a href="http://www.clearlyandsimply.com/clearly_and_simply/2012/11/interactive-tooltips-on-excel-worksheets.html" title="Interactive Tooltips on Excel Worksheets">Interactive Tooltips on Excel Worksheets</a>.</p>
<p>What’s different? </p>
<p>Firstly, you need 2 named ranges for the data (e.g. “myStates” and “myCounties”).</p>
<p>Secondly, the VBA is different. The code in the sheet module (sub Worksheet_SelectionChange) is even simpler than before.&#0160; However, you need another function retrieving the county details for the selected state (function GetCountyDetails in module modGetCountyData). The code isn’t very complicated. Basically it is working like a filter, i.e. it loops through all counties and returns only those belonging to the current state (selected row).</p>
<p>Here is the workbook for free download:</p>
<p style="text-align: center;"><a href="http://www.clearlyandsimply.com/files/2012/11/interactive_tooltip_lookup_details.xls" title="Download Interactive Tooltip Lookup Details (Microsoft Excel 2003, 670.5K)">Download Interactive Tooltip Lookup Details (Microsoft Excel 2003, 670.5K)</a></p>
<h4><span style="font-weight: bold;">Example 2 – Side calculations based on the value of the active cell</span></h4>
<p>In this example, we have data including some currency values (like prices or margins) and a second worksheet containing the exchange rates for other currencies updated via a data connection to a financial website. </p>
<p>The idea of this use case is to provide a list of other currencies, including the exchange rate and the conversion of the USD amount of the active cell into each currency. The amounts in all currencies are not calculated by the VBA code but rather by a simple formula in the ActiveX Spreadsheet Control (e.g. = B4*$C$1). Hence, the user has also the option to overwrite the USD value in cell C3 of the tooltip (top right) and immediately gets the results for the entered value:</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d85dc46970c-pi"><img alt="Exchange Rates - click to enlarge" border="0" height="324" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d85dc5f970c-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border: 0px;" title="Exchange Rates - click to enlarge" width="520" /></a></p>
<p>Again we need a second range name (“myExchangeRates”) and a few modifications in the VBA: the code updates the exchange rates in the ActiveX Spreadsheet Control, checks if the active cell has a currency format, writes the value of the active cell to cell C3 of the Spreadsheet Control and finally displays and positions the tooltip:</p>
<p style="text-align: center;"><a href="http://www.clearlyandsimply.com/files/2012/11/interactive_tooltip_exchange_rates.xls" title="Download Interactive Tooltip Exchange Rates (Microsoft Excel 2003, 123.5K)">Download Interactive Tooltip Exchange Rates (Microsoft Excel 2003, 123.5K)</a>&#0160;</p>
<h4><span style="font-weight: bold;">Example 3 - Enhanced Summary Card</span></h4>
<p>The <a href="http://www.clearlyandsimply.com/clearly_and_simply/2012/11/interactive-tooltips-on-excel-worksheets.html" title="Interactive Tooltips on Excel Worksheets">how-to post</a> used the example of a Summary Card in the tooltip, i.e. showing aggregation results of the selected range, like sum, average, maximum, etc. </p>
<p>A helpful little tooltip, but it comes with 2 limitations: </p>
<ol>
<li>It does not provide much more information than Excel’s status bar displays already by default</li>
<li>It aggregates all data of the selected range. This is fine as long as the selected range only covers one column of the data, but it doesn’t make much sense to display e.g. the sum of order quantity and order prices.</li>
</ol>
<p>The Summary Card of <a href="http://www.tableausoftware.com" title="Tableau Software">Tableau</a>, for one, shows the aggregations per measure used in the view:</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d85dc6d970c-pi"><img alt="Tableau Summary Card - click to enlarge" border="0" height="211" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee4fb0301970d-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Tableau Summary Card - click to enlarge" width="154" /></a></p>
<p>Having said that, we can enhance our Summary Card spreadsheet tooltip to do something very similar, i.e. to show the aggregations in different columns, like this:</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d85dc8e970c-pi"><img alt="Summary Card Enhanced - click to enlarge" border="0" height="314" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee4fb032c970d-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Summary Card Enhanced - click to enlarge" width="520" /></a></p>
<p>The VBA code is a bit longer (55 lines of code compared to 37 in the simple version), but it isn’t really complex. </p>
<p>In a nutshell it loops through the columns of the selected range, performs the calculations column by column, writes it to the according columns of the ActiveX Spreadsheet Control and finally adjusts the viewable range of the tooltip.</p>
<p>There is a lot of room for optimization (e.g. the count is always the same for all measures, so it should be displayed only once above the table, see also the Tableau Summary Card screenshot above), but I am sure you get the idea. For the details please have a look at the workbook:</p>
<p style="text-align: center;"><a href="http://www.clearlyandsimply.com/files/2012/11/interactive_tooltip_summary_card_enhanced.xls" title="Download Interactive Tooltip Summary Card Enhanced (Microsoft Excel 2003, 86.5K)">Download Interactive Tooltip Summary Card Enhanced (Microsoft Excel 2003, 86.5K)</a>&#0160;</p>
<h4><span style="font-weight: bold;">Conclusion</span></h4>
<p>As mentioned in the update at the bottom of the <a href="http://www.clearlyandsimply.com/clearly_and_simply/2012/11/interactive-tooltips-on-excel-worksheets.html" title="Interactive Tooltips on Excel Worksheets">previous post</a> and in the introduction to this article, the entire technique has one major limitation: The ActiveX Spreadsheet Control is not available by default if you are running Excel 2007 / 2010. However, if you are still using Office 2003 or don’t mind to install the Office Web Components, a tooltip including the ActiveX Spreadsheet Control might still be an interesting interactive feature for your models.</p>
<p>Stay tuned.</p><img src="http://feeds.feedburner.com/~r/ClearlyAndSimply/~4/IUx3qOBNVfo" height="1" width="1"/>]]></content:encoded>


<category>Data Analysis</category>
<category>Microsoft Excel</category>

<dc:creator>Robert</dc:creator>
<pubDate>Sun, 11 Nov 2012 19:00:00 +0100</pubDate>

<feedburner:origLink>http://www.clearlyandsimply.com/clearly_and_simply/2012/11/interactive-tooltip-examples.html</feedburner:origLink></item>
<item>
<title>Interactive Tooltips on Excel Worksheets</title>
<link>http://feedproxy.google.com/~r/ClearlyAndSimply/~3/gDXG2ov32dc/interactive-tooltips-on-excel-worksheets.html</link>
<guid isPermaLink="false">http://www.clearlyandsimply.com/clearly_and_simply/2012/11/interactive-tooltips-on-excel-worksheets.html</guid>
<description>The Next Level of Tooltips on Excel Worksheets: Taking Advantage of the ActiveX Spreadsheet Control </description>
<content:encoded><![CDATA[<h3><span style="font-weight: bold;">The Next Level of Tooltips on Excel Worksheets:      Taking Advantage of the ActiveX Spreadsheet Control </span></h3>
<p><a href="http://www.flickr.com/photos/9289838@N06/4385226417/" title="Marchant mechanical calculating machine - Photographer: Ian&#39;s Shutter Habit (flickr.com)"><img align="left" alt="Marchant mechanical calculating machine - Photographer: Ian&#39;s Shutter Habit (flickr.com)" border="0" height="180" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c334b86f6970b-pi" style="background-image: none; margin: 0px 15px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; padding-top: 0px; border-width: 0px;" title="Marchant mechanical calculating machine - Photographer: Ian&#39;s Shutter Habit (flickr.com)" width="260" /></a>Tooltips are one of the most helpful features when prospecting large data sets. </p>
<p>We already had a couple of articles talking about tooltips, on charts and on worksheets:</p>
<p><a href="http://www.clearlyandsimply.com/clearly_and_simply/2011/05/tooltips-on-microsoft-excel-tables.html" title="Tooltips on Microsoft Excel Tables">Tooltips on Microsoft Excel Tables</a></p>
<p><a href="http://www.clearlyandsimply.com/clearly_and_simply/2011/05/charts-in-excel-table-tooltips.html" title="Charts in Excel Table Tooltips">Charts in Excel Table Tooltips</a></p>
<p><a href="http://www.clearlyandsimply.com/clearly_and_simply/2011/05/display-all-fields-of-a-row-in-large-excel-tables.html" title="Display all Fields of a Row in large Excel Tables">Display all Fields of a Row in large Excel Tables</a></p>
<p><a href="http://www.clearlyandsimply.com/clearly_and_simply/2010/12/better-chart-tooltips-with-microsoft-excel-2010.html" title="Better Chart Tooltips with Microsoft Excel 2010">Better Chart Tooltips with Microsoft Excel 2010</a></p>
<p>Today’s post is trying to take this to the next level: an interactive tooltip on a Microsoft Excel worksheet. You may ask: </p>
<p style="text-align: center;"><em>“What the heck is an interactive tooltip?”</em></p>
<p>What I am thinking of is a tooltip enabling you not only to read additional information but also interact with it. E.g. copy data from the tooltip and paste it somewhere else, do side calculations based on the currently selected data, browse through a longer list of data in the tooltip, etc.</p>
<p>Impossible? No it isn’t. Microsoft provides a very useful ActiveX control which enables us to do exactly this: the Microsoft Office Spreadsheet Control. Today’s post shows how to take advantage of this ActiveX control in order to provide an interactive tooltip on Excel worksheets - as always including the Excel workbook for free download. </p>

<h4><span style="font-weight: bold;">The Idea</span></h4>
<p>Microsoft Office / Excel comes with a lot of very interesting and powerful ActiveX controls. One of them is the Microsoft Spreadsheet ActiveX Control. It may sound a bit weird to use a spreadsheet control within a spreadsheet, but it offers a lot of interesting options. </p>
<p>The basic idea of this post is using the spreadsheet control as an interactive tooltip on Excel worksheets. In order to keep things “as simple as possible, but not any simpler” (Albert Einstein), I will describe the idea by displaying a “Summary Card” (see also <a href="http://www.clearlyandsimply.com/clearly_and_simply/2011/03/tableau-quick-tip-1-the-summary-card.html" title="Tableau Quick Tip #1 - The Summary Card">Tableau Quick Tip #1 - The Summary Card</a>) of the selected range in a tooltip on simple list of data in Excel:</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c334b870b970b-pi"><img alt="Interactive Tooltip Summary Card - click to enlarge" border="0" height="318" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d7a1c34970c-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Interactive Tooltip Summary Card - click to enlarge" width="520" /></a>The Summary Card displays sum, average, minimum, maximum, count, median and standard deviation of the values in the selected range. Agreed, all of this information (except for median and standard deviation) is available in Excel’s status bar at the bottom right already (in Excel 2007/2010, in Excel 2003 and earlier you only have one of them). However, this is just the first step to show the technique in general. I will provide more useful examples in the next article.</p>
<p>Let’s get started. Here is the how to:</p>
<h4><span style="font-weight: bold;">The Step-by-Step Tutorial</span></h4>
<p><strong>Step 1 – Bring your Ducks in a Rows</strong></p>
<p>Insert a data table into a Microsoft Excel worksheet and define a name for the range containing the data (“myData” in my example).</p>
<p><strong>Step 2 – Insert a Microsoft Spreadsheet ActiveX Control</strong></p>
<p>On the Developer tab click on Insert and More Controls:</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee4ef590a970d-pi"><img alt="ActiveX Controls - click to enlarge" border="0" height="238" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d7a1c57970c-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="ActiveX Controls - click to enlarge" width="260" /></a>In the following dialogue window scroll down to the Microsoft Spreadsheet 11.0 control and click on Ok:</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d7a1c5f970c-pi"><img alt="Microsoft Office Spreadsheet Control - click to enlarge" border="0" height="249" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee4ef5940970d-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="Microsoft Office Spreadsheet Control - click to enlarge" width="260" /></a></p>
<p>The cursor changes to a cross. Simply click somewhere on your worksheet and the Spreadsheet Control will be inserted.</p>
<p><strong>Step 3 – Change the Properties of the Microsoft Spreadsheet ActiveX Control</strong></p>
<p>On the Developer Tab click on Design Mode, select the ActiveX Control and click on Properties:</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c334b8769970b-pi"><img alt="Spreadsheet Properties - click to enlarge" border="0" height="535" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d7a1c92970c-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border: 0px;" title="Spreadsheet Properties - click to enlarge" width="370" /></a>You do not have to change much here. Simply define the caption (“Summary Card” in this example), set DisplayOfficeLogo and DisplayToolbar to False and define an appropriate height and width of the control object.</p>
<p><strong>Step 4 – Change the Options of the Microsoft Spreadsheet ActiveX Control</strong></p>
<p>Right click on the control and select Microsoft Office Spreadsheet 11.0 Object and Command and Options:</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d7a1c9c970c-pi"><img alt="Commands and Options - click to enlarge" border="0" height="201" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d7a1cae970c-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Commands and Options - click to enlarge" width="370" /></a>First tab we go to is Workbook:</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d7a1cc3970c-pi"><img alt="Workbook Settings - click to enlarge" border="0" height="314" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d7a1cd7970c-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Workbook Settings - click to enlarge" width="320" /></a>Uncheck the scrollbars and the sheet selector, delete all sheets except for Sheet1 and rename the sheet (Summary Card).</p>
<p>Next we go to the Sheet tab:</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d7a1cf2970c-pi"><img alt="Sheet Settings - click to enlarge" border="0" height="314" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee4ef59c0970d-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Sheet Settings - click to enlarge" width="320" /></a>Uncheck row headers, column headers and gridlines and define the viewable range. For the summary card example, we need only 2 columns and 7 rows, so we set the viewable range to $A$1:B$7.</p>
<p>Finally we define the column width and row height on the Advanced tab:</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d7a1d1a970c-pi"><img alt="Advanced Settings - click to enlarge" border="0" height="314" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d7a1d2b970c-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Advanced Settings - click to enlarge" width="320" /></a><strong>Step 5 – Format the Cells on the Microsoft Spreadsheet ActiveX Control</strong></p>
<p>You can use the Format tab in the Command and Options window (see step 4) to format the cells on the worksheet. However it is much easier and faster if you simply create a range on the Excel worksheet, format it as you like (fill colors, borders, number formats, etc.) and simply copy this range and paste it into the ActiveX control. Before you do so, you have to turn off Design Mode on the Developer tab.</p>
<p><strong>Step 6 – The VBA</strong></p>
<p>You guessed it: to make this work we need some VBA. But don’t worry, it is a really small code snippet (2 subs, 37 lines of code). The main part is the event driven procedure Worksheet_SelectionChange. There is one additional function checking if all cells in the selected range are numeric.</p>
<p>Here is what the code does in a nutshell:</p>
<ol>
<li>Check if the active cell is in the data table, i.e. within the defined range name (“myData”) </li>
<li>If so, check if the selected range has more than one cell and all cells in the selected range are numeric </li>
<li>If so, make the ActiveX control visible, position it at the bottom right of the selected range and insert the results (sum, average minimum, maximum, count, median and standard deviation) for the selected range using the Application.WorksheetFunction method </li>
<li>If not, hide the ActiveX control</li>
<li>Save the workbook as an Excel Macro Enabled Workbook </li>
</ol>
<p>That’s it.</p>
<h4><span style="font-weight: bold;">The Pros</span></h4>
<p>Well the pros are obvious, aren’t they?</p>
<p>The first one is the ease of implementation: 6 steps and a small piece of code and you are good to go.</p>
<p>Even more important is the interactivity. The ActiveX control is a limited spreadsheet in terms of its functionality, no doubt about it. Having said that, it offers many options you would not expect to have in a tooltip: users can do their own side calculations by entering values into the cells of the tooltip, you natively have the scrolling options for larger tables to be shown, you can easily copy content from the tooltip and paste it somewhere into the Excel workbook or elsewhere, and many more.</p>
<p>Last but not least, the technique offers many possibilities to create a highly interactive and responsive tooltip to prospect data tables. Maybe not suitable for all of your models, but definitely a very interesting option in some use cases.</p>
<h4><span style="font-weight: bold;">The Cons</span></h4>
<p>Well, there are not many cons I have encountered so far except for this one: if you change the zoom factor of the worksheet, the ActiveX control resizes too, but the content (i.e. the cell range of the spreadsheet tooltip) doesn’t. You will see something like this:</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c334b87e6970b-pi"><img alt="Zoom Issue - click to enlarge" border="0" height="387" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d7a1d4e970c-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Zoom Issue - click to enlarge" width="370" /></a>Not really nice, but a minor drawback in my humble opinion.</p>
<h4><span style="font-weight: bold;">The Download Link</span></h4>
<p style="text-align: center;"><a href="http://www.clearlyandsimply.com/files/2012/11/interactive_tooltip_summary_card.xls" title="Download Interactive Tooltip Summary Card (Microsoft Excel 2003, 73.5K)">Download Interactive Tooltip Summary Card (Microsoft Excel 2003, 73.5K)</a></p>
<h4><span style="font-weight: bold;">Acknowledgements</span></h4>
<p>Special thanks go again to Jordan Goldmeier of the <a href="http://optionexplicitvba.blogspot.de/" title="Option Explicit VBA Blog">Option Explicit VBA Blog</a> for reviewing my workbook, for his feedback and for encouraging me to write this article. Thanks, Jordan!</p>
<h4><span style="font-weight: bold;">What’s next?</span></h4>
<p>As mentioned above, this technique offers a variety of possibilities. Agreed, the Summary Card example does not really take advantage of the interactive features (except for the option to copy the content of the tooltip and paste it somewhere else). </p>
<p>The next post will provide a small selection of examples of what you can do with the ActiveX Spreadsheet control and how to make a really interactive tooltip.</p>
<p>Stay tuned.</p>
<h4><span style="font-weight: bold;">Update on Sunday, November 11, 2012 – A 
serious limitation</span></h4>
<p>In the cons section of the article I claimed the zooming issue would be the 
only drawback of this technique. It turned out that unfortunately this is only 
half the story. The ActiveX Spreadsheet Control is part of the so called Office 
Web Components. In his comments to this post (see below), reader &quot;Sg&quot; pointed to 
the fact that Microsoft discontinued the shipping of the Office Web Components 
with Office 2007 and later. This one was new to me. Although I am running Office 
2010, the Spreadsheet Control is available on my computer, probably because I 
have also installed Microsoft Project 2003.</p>
<p>Microsoft still provides the Office Web Components for free download (<a href="http://www.microsoft.com/en-us/download/details.aspx?id=22276">Office 2003 
Add-in: Office Web Components</a>) and if you install it, I suspect the ActiveX 
Spreadsheet should also work with Excel 2007/2010. 
</p>
<p>However, this is a serious limitation of the technique: you can’t easily 
distribute the workbook to other users running Excel 2007/2010. They would have 
to install the Web Components first and this considerably decreases the 
applicability of the ActiveX Spreadsheet Control for professional Excel 
models.</p>
<p>&#0160;</p><img src="http://feeds.feedburner.com/~r/ClearlyAndSimply/~4/gDXG2ov32dc" height="1" width="1"/>]]></content:encoded>


<category>Data Analysis</category>
<category>Microsoft Excel</category>

<dc:creator>Robert</dc:creator>
<pubDate>Sat, 10 Nov 2012 13:00:00 +0100</pubDate>

<feedburner:origLink>http://www.clearlyandsimply.com/clearly_and_simply/2012/11/interactive-tooltips-on-excel-worksheets.html</feedburner:origLink></item>
<item>
<title>Roll Over Tooltips and Web Actions on a Microsoft Excel Dashboard</title>
<link>http://feedproxy.google.com/~r/ClearlyAndSimply/~3/XU7KwqkFLFs/roll-over-tooltips-and-web-actions-on-a-microsoft-excel-dashboard.html</link>
<guid isPermaLink="false">http://www.clearlyandsimply.com/clearly_and_simply/2012/11/roll-over-tooltips-and-web-actions-on-a-microsoft-excel-dashboard.html</guid>
<description>Bluffing the “Beer Prices at Oktoberfest” Tableau Dashboard with Microsoft Excel using Roll Over Tooltips and Web Actions</description>
<content:encoded><![CDATA[<h3><span style="font-weight: bold;">Bluffing the “Beer Prices at Oktoberfest” Tableau Dashboard with Microsoft Excel using Roll Over Tooltips and Web Actions</span></h3>
<p><a href="http://www.flickr.com/photos/kudo88/5047521324/" title="Oktoberfest Impressionen - Photographer: sanfamedia (flickr.com)"><img align="left" alt="Oktoberfest Impressionen - Photographer: sanfamedia (flickr.com)" border="0" height="260" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c3318aa66970b-pi" style="background-image: none; margin: 0px 15px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; padding-top: 0px; border-width: 0px;" title="Oktoberfest Impressionen - Photographer: sanfamedia (flickr.com)" width="260" /></a>Recently we had an article visualizing the beer prices and beer price development at Oktoberfest with a <a href="http://www.tableausoftware.com/" title="Tableau Software">Tableau</a> dashboard: <a href="http://www.clearlyandsimply.com/clearly_and_simply/2012/09/ozapft-is.html" title="O&#39;zapft Is! - Beer Prices at Oktoberfest">O&#39;zapft Is!</a></p>
<p>Oktoberfest is long over already and there is peace in the valley of Munich again. Having said that, I would like to come back to this visualization once more. We had a couple of posts here on Clearly and Simply showing how to bluff Tableau’s great interactive features with Microsoft Excel: </p>
<p><a href="http://www.clearlyandsimply.com/clearly_and_simply/2010/08/bluffing-tableau-actions-with-microsoft-excel.html" target="_blank" title="Bluffing Tableau Actions with Microsoft Excel">Bluffing Tableau Actions with Microsoft Excel</a></p>
<p><a href="http://www.clearlyandsimply.com/clearly_and_simply/2009/11/bluffing-a-visual-cross-tab-with-excel.html" target="_blank" title="Bluffing a Visual Cross-tab with Excel">Bluffing a Visual Cross-tab with Excel</a></p>
<p><a href="http://www.clearlyandsimply.com/clearly_and_simply/2011/03/the-next-level-of-interactive-microsoft-excel-dashboards.html" target="_blank" title="The Next Level of Interactive Microsoft Excel Dashboards">The Next Level of Interactive Microsoft Excel Dashboards</a></p>
<p><a href="http://www.clearlyandsimply.com/clearly_and_simply/2011/01/microsoft-excel-site-catchment-analysis-part-1.html" target="_blank" title="Microsoft Excel Site Catchment Analysis">Microsoft Excel Site Catchment Analysis</a></p>
<p>Drawing on this tradition, today’s article presents an Excel workbook emulating the Tableau Oktoberfest Dashboard. The technique behind this bluff is a very clever approach my blogging colleague Jordan Goldmeier published in several articles over at his <a href="http://optionexplicitvba.blogspot.de/" title="Option Explicit VBA Blog">Option Explicit VBA Blog</a>.</p>
<p>Stealing Jordan’s idea, today’s post shows how to recreate the Oktoberfest Beer Price Tableau dashboard with Microsoft Excel, as always including the Excel workbook for free download. </p>

<h4><strong>The Challenge</strong></h4>
<p><a href="http://www.clearlyandsimply.com/clearly_and_simply/2012/09/ozapft-is.html" title="O&#39;zapft Is - Beer Prices at Oktoberfest">O&#39;zapft Is</a> presented a Tableau Dashboard visualizing the prices of beer and other beverages and the beer price trends at Oktoberfest, including </p>
<ul>
<li>a map displaying tooltips with beverage prices and additional information about each beer tent and a selected year in the tooltips </li>
<li>a URL action opening a link to the tent’s website on muenchen.de </li>
<li>a band chart visualizing the beer price development of the selected tent since 2002 within the total range of the beer prices across all tents </li>
</ul>
<p>The Tableau folks liked my little dashboard and selected it as the “Tableau Viz of the Day” on September 26, 2012: <a href="http://www.tableausoftware.com/public/gallery/beer-prices-oktoberfest" title="Viz of the Day - Beer Prices at Oktoberfest">Beer Prices at Oktoberfest</a>.</p>
<p>Today’s challenge is re-creating this dashboard with Microsoft Excel. In the end, the Excel dashboard will look like this:</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c3318aa90970b-pi"><img alt="Beer Prices at Oktoberfest - click to enlarge" border="0" height="501" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d472f51970c-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Beer Prices at Oktoberfest - click to enlarge" width="520" /></a></p>
<p>To be more precise, the Excel Dashboard should not only look like the Tableau Viz, it should also have the main interactive features Tableau provides more or less natively:</p>
<p><strong>Tooltip when hovering over a tent</strong></p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d472f9e970c-pi"><img alt="Oktoberfest Map and Tooltip - click to enlarge" border="0" height="295" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee4bcc2b7970d-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Oktoberfest Map and Tooltip - click to enlarge" width="520" /></a><strong>Open a link in a web browser after clicking on a tent</strong></p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee4bcc315970d-pi"><img alt="Oktoberfest Map and Web Browser- click to enlarge" border="0" height="291" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c3318aba3970b-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Oktoberfest Map and Web Browser- click to enlarge" width="520" /></a></p>
<p>And of course the option to select a year and a tent in a dropdown (combo box) as well as the band chart.</p>
<h4><span style="font-weight: bold;">The Technique</span></h4>
<p>The heart of this solution is Jordan Goldmeier’s “Roll Over Macro Execution” technique described in this blog post: <a href="http://optionexplicitvba.blogspot.de/2011/04/rollover-b8-ov1.html" title="How to Create a Rollover Effect in Excel">How to Create a Rollover Effect in Excel</a>.</p>
<p>The basic idea is stellar: Jordan uses a User Defined VBA Function inside a Excel HYPERLINK function like this:</p>
<p style="text-align: center;"><em>=HYPERLINK(myUserDefinedFunction(),&quot;&quot;)</em></p>
<p>There are a few interesting things which were totally new to me</p>
<ul>
<li>I didn’t know you can use a UDF within a hyperlink </li>
<li>A UDF can usually not change values or other properties of other cells. However, if they are used within hyperlinks, they can </li>
<li>The UDF is not only fired when clicking on the cell, but also when hovering over it with the mouse </li>
</ul>
<p>An impressive and very innovative idea by Jordan which offers a variety of new possibilities. In his latest post, for one, Jordan used this technique for an excellent visualization of an Interactive Electoral Scoreboard of the United States:</p>
<p><a href="http://optionexplicitvba.blogspot.de/2012/10/interactive-united-states-2012.html" title="Option Explicit VBA Blog - Interactive US 2012"><img alt="Option Explicit VBA Blog - Interactive US 2012" border="0" height="324" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee4bcc345970d-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Option Explicit VBA Blog - Interactive US 2012" width="520" /></a></p>
<p>Fantastic work, Jordan!</p>
<p>If you want to learn more about the details of this technique, please refer to one of Jordan’s articles:</p>
<p style="text-align: center;"><a href="http://optionexplicitvba.blogspot.de/2012/09/the-excel-rollover-mini-faq.html" title="The Excel Rollover Mini FAQ">The Excel Rollover Mini FAQ</a> </p>
<p>and / or to Chandoo’s post featuring this technique:</p>
<p style="text-align: center;"><a href="http://chandoo.org/wp/2011/07/20/interactive-dashboard-using-hyperlinks/" title="Interactive Dashboard in Excel using Hyperlinks">Interactive Dashboard in Excel using Hyperlinks</a></p>
<p>Now let’s try to apply this technique to the Oktoberfest Dashboard. Here is the step-by-step how-to:</p>
<h4><span style="font-weight: bold;">Step 1 – The Data</span></h4>
<p>This is the easy part. We already have the data available from the original Tableau article (<a href="http://www.clearlyandsimply.com/clearly_and_simply/2012/09/ozapft-is.html" title="O&#39;zapft Is! - Beer Prices at Oktoberfest">O&#39;zapft Is!</a>). We simply insert 2 worksheets ([data tents] and [data_prices] into a new Excel workbook. The sheet [data_tents] contains the names of the tents, the seats, the breweries and the URLs of the tents. The sheet [data_prices] holds all the prices for all tents and all beverages from 2002 to 2012.</p>
<h4><span style="font-weight: bold;">Step 2 – Prepare the Roll Over</span></h4>
<p>First we create a new worksheet (the dashboard) and format it to have a squared cell grid, i.e. cells which have approximately the same width and height. Next, we insert the image of the Oktoberfest:</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d4730b6970c-pi"><img alt="Square Grid Map - click to enlarge" border="0" height="278" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c3318ac52970b-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Square Grid Map - click to enlarge" width="520" /></a>The <a href="http://optionexplicitvba.blogspot.de/2012/10/interactive-united-states-2012.html" title="Interactive Electoral Scoreboard">Interactive Electoral Scoreboard</a> uses a map of the United States consisting of freeform shapes (one shape per state). To determine the current state (i.e. the shape the mouse is currently hovering over), Jordan developed a very clever technique combining Excel worksheet formulas with some VBA User Defined Functions. I will not go into the details here. To find out more about the approach, please refer to <a href="http://optionexplicitvba.blogspot.de/2012/10/interactive-united-states-2012.html" target="_blank" title="Interactive Electoral Scoreboard">Jordan’s article and workbook</a>. </p>
<p>The “map” of the Oktoberfest does not consist of several shapes. It is just one single image inserted into the Excel worksheet. Hence, we have to replace Jordan’s technique of calculating the correct shape / state by a manual setup. </p>
<p>First we number all 14 (large) tents visible on the map:</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee4bcc3df970d-pi"><img alt="Oktoberfest Tents - click to enlarge" border="0" height="260" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee4bcc3ea970d-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Oktoberfest Tents - click to enlarge" width="198" /></a>Next step is the laborious part of the implementation: we manually insert the numbers of the tents according to their positions on the map into the cells of the worksheet: </p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017ee4bcc439970d-pi"><img alt="Oktoberfest Tents Postions on Map - click to enlarge" border="0" height="276" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c3318ad10970b-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Oktoberfest Tents Postions on Map - click to enlarge" width="520" /></a>The result is a lookup matrix we will later use to identify which cell of the grid belongs to which tent. Since we will need the cells on the dashboard for the HYPERLINK formulas, we move this lookup matrix of tent positions to another worksheet ([control]):</p>
<p><a href="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017c3318ad1e970b-pi"><img alt="Tent Postion Coding - click to enlarge" border="0" height="217" src="http://www.clearlyandsimply.com/.a/6a00e554d9fb998833017d3d47318b970c-pi" style="background-image: none; margin: 10px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Tent Postion Coding - click to enlarge" width="420" /></a></p>
<p>Agreed, this isn’t 100% exact, since the cell grid is not detailed enough to exactly cover the sizes of the tents. However, it is close enough for our purposes.&#0160; </p>
<h4><span style="font-weight: bold;">Step 3 – The Control Worksheet</span></h4>
<p>Besides the tent position matrix (see step 2 above), some more preparation work is necessary on the [control] worksheet, like</p>
<ul>
<li>lists and target cells for the drop downs (year and tent) on the dashboard </li>
<li>a formula to calculate the position of the selected year and tent in the data </li>
<li>a formula to retrieve the URL of the selected tent </li>
<li>a cell range with all labels and formulas we want to show in the tooltip </li>
<li>a cell range to calculate the relevant data series for the band chart </li>
</ul>
<p>INDEX, VLOOKUP, MATCH and a couple of&#0160; more complex array formulas, but nothing really new under the sun.</p>
<p>Finally we define a couple of names for some cells on worksheet [control], like the index and name of the current tent, the URL and the range containing the tooltip content.</p>
<h4><span style="font-weight: bold;">Step 4 – The Dashboard</span></h4>
<p><strong>Step 4.1 – The Hyperlinks</strong></p>
<p>First step of setting up the dashboard is defining a name for the cell range with the tents beneath the image. This range has exactly the same size as the lookup matrix for the tent positions we created in step 2. In my example workbook the name of this range is “myWiesn” (for your understanding: we Bavarians call the Oktoberfest “Wiesn”…). </p>
<p>This is the point where the hyperlink trick of Jordan’s rollover technique comes into play. We insert the following formula in the first cell of “myWiesn”:</p>
<p>=IFERROR(HYPERLINK(Define_HyperLink(ROW(P9),COLUMN(P9),control!I6),&quot;&quot;),&quot;&quot;)</p>
<p>where control!I6 is the reference to the upper left cell of the tent position matrix on worksheet [control] and Define_Hyperlink is a User Defined Function we will create in step 5. Finally we copy this formula to all cells of “myWiesn.”</p>
<p><strong>Step 4.2 – The Shapes</strong></p>
<p>We need two textboxes on the dashboard: </p>
<ol>
<li>The first one (called “shpClickBox”) has the same size as the cells and is formatted to be invisible (no fill color, no line color). It is used to handle the web actions when clicking on them </li>
<li>The second one (called “shpToolTip”) is linked to the cell range on worksheet [control] containing all information to be displayed in the tooltip </li>
</ol>
<p><strong>Step 4.3 – Everything else on the Dashboard</strong></p>
<p>The usual suspects: 2 combo boxes to select a year and a tent and a band chart (see also: <a href="http://www.clearlyandsimply.com/clearly_and_simply/2011/04/an-underrated-chart-type-the-band-chart.html" target="_blank" title="An Underrated Chart Type: The Band Chart">An Underrated Chart Type: The Band Chart</a>) using the data series we calculated on the sheet [control] in step 3. I guess I do not have to explain this in detail.</p>
<h4><span style="font-weight: bold;">Step 5 – The VBA</span></h4>
<p>You may expect a lot of very complicated VBA code to make this work. However, the VBA is pretty simple. In fact it only consists of 5 subs / functions and only 39 (!) lines of code in total.</p>
<p>Here is a short description of those 5 subs:</p>
<ol>
<li>In the event driven Worksheet_SelectionChange sub of the worksheet [dashboard], the tooltip shape is set to be invisible if the user clicks some cell outside of the map. </li>
<li>The User Defined Function called in the HYPERLINK formulas (see step 4.1) checks first if the cell value is greater than 0 (i.e. the cell beneath the image is a tent). If so, it updates the cell containing the current tent index, positions the click box shape above the cell and positions and shows the tooltip shape. If not, it makes the tooltip invisible. Finally it calls another procedure: SetHyperlink </li>
<li>SetHyperlink adds / updates the hyperlink to the current cell at the top right of the dashboard </li>
<li>ChangeTentDropDown is hooked up to the combo box for selecting a year and simply makes the tooltip invisible and calls SetHyperlink </li>
<li>OpenURL is called when the the user clicks on the click box shape and simply opens the browser with the URL of the current tent </li>
</ol>
<p>If you are interested in more details, please have a look at the VBA of the workbook (download link see below). If you have any questions, please leave me a comment.</p>
<p>That’s it. </p>
<p>With Tableau, creating the dashboard only took a few minutes. It is by far more work to implement this in Microsoft Excel, but it isn’t impossible. If you can’t get your hands on Tableau, you can still create create an interesting and highly interactive dashboard with Microsoft Excel. </p>
<h4><span style="font-weight: bold;">The Download Link</span></h4>
<p>Here is the workbook for free download:</p>
<p style="text-align: center;"><a href="http://www.clearlyandsimply.com/files/2012/11/beer_prices_at_oktoberfest.xlsm" target="_self" title="Download Beer Prices at Oktoberfest (Microsoft Excel 2007/2010 workbook, 1,042.4K)">Download Beer Prices at Oktoberfest (Microsoft Excel 2007/2010 workbook, 1,042.4K)</a></p>
<h4><span style="font-weight: bold;">Acknowledgements</span></h4>
<p>Special thanks go of course to Jordan Goldmeier of the <a href="http://optionexplicitvba.blogspot.de/" title="Option Explicit VBA Blog">Option Explicit VBA Blog</a> for inventing and sharing this technique. </p>
<p>Excellent work. Kudos, Jordan!</p>
<h4><span style="font-weight: bold;">What’s next?</span></h4>
<p>That’s it with Oktoberfest. I promise. At the very least for this year. I am planning a couple of new posts on something completely different in November for both tools, Excel and Tableau.</p>
<p>Stay tuned.</p><img src="http://feeds.feedburner.com/~r/ClearlyAndSimply/~4/XU7KwqkFLFs" height="1" width="1"/>]]></content:encoded>


<category>Dashboards</category>
<category>Microsoft Excel</category>
<category>Visualization</category>

<dc:creator>Robert</dc:creator>
<pubDate>Sun, 04 Nov 2012 18:00:00 +0100</pubDate>

<feedburner:origLink>http://www.clearlyandsimply.com/clearly_and_simply/2012/11/roll-over-tooltips-and-web-actions-on-a-microsoft-excel-dashboard.html</feedburner:origLink></item>

</channel>
</rss><!-- ph=1 -->
