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

<channel>
	<title>Bacon Bits: &#187; Union Queries</title>
	<atom:link href="http://datapigtechnologies.com/blog/index.php/tag/union-queries/feed/" rel="self" type="application/rss+xml" />
	<link>http://datapigtechnologies.com/blog</link>
	<description>A DataPig Technologies Blog</description>
	<lastBuildDate>Wed, 08 Sep 2010 12:25:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adding Trend Icons to Access Queries</title>
		<link>http://datapigtechnologies.com/blog/index.php/adding-trend-icons-to-access-queries/</link>
		<comments>http://datapigtechnologies.com/blog/index.php/adding-trend-icons-to-access-queries/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 12:48:42 +0000</pubDate>
		<dc:creator>datapig</dc:creator>
				<category><![CDATA[Access Queries]]></category>
		<category><![CDATA[Access Tips and Tricks]]></category>
		<category><![CDATA[Visualizations]]></category>
		<category><![CDATA[Access]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Union Queries]]></category>
		<category><![CDATA[Visualization]]></category>

		<guid isPermaLink="false">http://datapigtechnologies.com/blog/?p=1838</guid>
		<description><![CDATA[With the release of Office 2007, Excel introduced cool new conditional formatting rules that gave you the ability to show dashboard-esque icons inside cells. With these icons, you can represent performance using different shapes and colors.
 
As usual, Access gets the short end of the visualization stick. No such functionality exists in your cache of Access [...]]]></description>
			<content:encoded><![CDATA[<p>With the release of Office 2007, Excel introduced cool new conditional formatting rules that gave you the ability to show dashboard-esque icons inside cells. With these icons, you can represent performance using different shapes and colors.</p>
<p> </p>
<p>As usual, Access gets the short end of the visualization stick. No such functionality exists in your cache of Access tools. But today, I'll show you how to hack your way into showing dashboard-esque icons in Access queries.</p>
<p> <span id="more-1838"></span></p>
<p>Let's go through an exercise to get some trend icons. I'll start with this query that compares Actual performance versus Forecast. As you can see, the Variance column is in the garden-variety percent format. This is fine, but it takes a moment to pick out the markets that have negative variances. It would be nice to make those Pop out more quickly.</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2010/03/032310_1243_AddingTrend1.png" alt="" /></p>
<p> </p>
<p> </p>
<p>At this point, you may be thinking, "I'll just use the old Wingdings to give the negative variances a symbol of some sort".</p>
<p>No dice there. It's an all or nothing formatting situation in Access Queries. So using Wingdings font simply makes your entire query look like the bathroom wall of some ancient Egyptian bar.</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2010/03/032310_1243_AddingTrend2.png" alt="" /></p>
<p> </p>
<p> </p>
<p>One creative alternative is to use the ChrW function. The ChrW function returns Unicode characters based on a character number. For instance, ChrW(9608) returns a block character. These characters allow you to mimic Excel's icon sets, using symbols to create visual representations of performance.</p>
<p>I've listed the codes for Unicode characters resembling the icons you often seen on dashboard reports. Again, the idea is to pass the character number through the ChrW function. For example, ChrW(9650) would return an up arrow symbol.</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2010/03/032310_1243_AddingTrend3.png" alt="" /></p>
<p> </p>
<p> </p>
<p>Now that I know the codes to use, I can implement them in my query. As you can see here, I'm updating my query to include a 'Trend Icon' column. This column will evaluate the Variance column to see if the Variance column is greater than or equal to zero. If it is, it does nothing. If the Variance column is less than zero, the character ChrW(9660) is used.</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2010/03/032310_1243_AddingTrend4.png" alt="" /></p>
<p> </p>
<p> </p>
<p>The effect we get is pretty nifty.</p>
<p>There is a new Trend Icon column that shows a down arrow for each market whose Variance is less than 0. This helps our audience to quickly point out the problem Markets.</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2010/03/032310_1243_AddingTrend5.png" alt="" /></p>
<p> </p>
<p>I'll be back soon with another blindingly awesome post.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://datapigtechnologies.com/blog/index.php/data-bars-in-excel-2003-without-rept/" rel="bookmark" class="crp_title">Data Bars in Excel 2003 &#8211; without REPT</a></li><li><a href="http://datapigtechnologies.com/blog/index.php/why-find-when-you-can-search/" rel="bookmark" class="crp_title">Why FIND when you can SEARCH</a></li><li><a href="http://datapigtechnologies.com/blog/index.php/using-dashboard-graphics-in-access/" rel="bookmark" class="crp_title">Using Dashboard Graphics in Access</a></li><li><a href="http://datapigtechnologies.com/blog/index.php/special-characters-are-a-pain-in-the-asterisk/" rel="bookmark" class="crp_title">Special Characters are a Pain in the Asterisk</a></li><li><a href="http://datapigtechnologies.com/blog/index.php/adding-visualizations-to-your-pivot-tables/" rel="bookmark" class="crp_title">Adding Visualizations to your Pivot Tables</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://datapigtechnologies.com/blog/index.php/adding-trend-icons-to-access-queries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Access to Combine Multiple Excel Files: Method 1</title>
		<link>http://datapigtechnologies.com/blog/index.php/using-access-to-combine-multiple-excel-files-method-1/</link>
		<comments>http://datapigtechnologies.com/blog/index.php/using-access-to-combine-multiple-excel-files-method-1/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 05:38:36 +0000</pubDate>
		<dc:creator>datapig</dc:creator>
				<category><![CDATA[Excel & Access Integration]]></category>
		<category><![CDATA[Access]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[Linked Tables]]></category>
		<category><![CDATA[Union Queries]]></category>

		<guid isPermaLink="false">http://datapigtechnologies.com/blog/?p=64</guid>
		<description><![CDATA[Ahh, the classic story. Boy gets job. Boy becomes the department data collector. Boy meets 25 Admins who send him a spreadsheet every week. Boy copies and pastes into one workbook. Boy lights himself on fire.
Combining multiple Excel worksheets into one data table is such a common task, I would bet a pound of bacon [...]]]></description>
			<content:encoded><![CDATA[<p>Ahh, the classic story. Boy gets job. Boy becomes the department data collector. Boy meets 25 Admins who send him a spreadsheet every week. Boy copies and pastes into one workbook. Boy lights himself on fire.</p>
<p>Combining multiple Excel worksheets into one data table is such a common task, I would bet a pound of bacon that most of us have been through that ordeal once or twice.</p>
<p>The good news is that you can just scour the internet, and you'll probably find dozens of techniques for combining multiple Excel files together.</p>
<p>Here's one simple way you can leverage Access to combine multiple Excel files (without VBA).</p>
<p><span id="more-64"></span></p>
<p><strong>Step 1: Create links to your Excel workbooks in Access.<br />
</strong></p>
<p>     <img src="http://datapigtechnologies.com/blog/wp-content/uploads/2009/06/061209-0538-usingaccess1.png" alt="" /></p>
<p style="margin-left: 36pt"> </p>
<p style="margin-left: 36pt">You'll have to repeat this process for each excel workbook you until you have them all linked in your database.</p>
<p style="margin-left: 36pt">As you can see, the Excel linked tables are easy to spot.</p>
<p>     <img src="http://datapigtechnologies.com/blog/wp-content/uploads/2009/06/061209-0538-usingaccess2.png" alt="" /></p>
<p> </p>
<p><strong>Step 2: Start a new query in SQL View<br />
</strong></p>
<p>       <img src="http://datapigtechnologies.com/blog/wp-content/uploads/2009/06/061209-0538-usingaccess3.png" alt="" /></p>
<p> </p>
<p><strong>Step 3: In SQL View, start typing Select statements for all the linked Excel tables, using the Union operator between each select statement.<br />
</strong></p>
<p>     <img src="http://datapigtechnologies.com/blog/wp-content/uploads/2009/06/061209-0538-usingaccess4.png" alt="" /><strong><br />
</strong></p>
<p> </p>
<p><strong>Step 4: Save and Run the query.<br />
</strong></p>
<p>The result will be a single dataset containing the combined data from all the linked files.</p>
<p>As long as the linked Excel files are in the same location, Access will automatically refresh the links for data changes each time you open the database. This means you can run through this setup once, then simply run the union query each time you need to re-combine the your Excel files.</p>
<p>Next week, I'll cover another method of using Access to combine Excel workbooks.</p>
<p><span style="color: #800000;"><strong>Update:<br />
</strong><span style="color: #000000;">Rob correctly points out that I negelected to mention a  key rule about the UNION operator. </span> </span></p>
<p><span style="color: #000000;">The UNION operater will, by default, remove any duplicate rows you may have in your data.  If you know that you will have duplicate rows in your data  and you want to keep them,  you'll need to use UNION ALL.  UNION ALL will allow the duplicate rows to come through. </span></p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://datapigtechnologies.com/blog/index.php/using-access-to-combine-multiple-excel-files-method-2/" rel="bookmark" class="crp_title">Using Access to Combine Multiple Excel Files: Method 2</a></li><li><a href="http://datapigtechnologies.com/blog/index.php/zoom-into-spreadsheet-on-double-click/" rel="bookmark" class="crp_title">Zoom into Spreadsheet on Double-Click</a></li><li><a href="http://datapigtechnologies.com/blog/index.php/cut-the-size-of-your-pivot-table-workbooks-in-half/" rel="bookmark" class="crp_title">Cut the Size of Your Pivot Table Workbooks in Half</a></li><li><a href="http://datapigtechnologies.com/blog/index.php/sending-variable-access-data-to-an-excel-range/" rel="bookmark" class="crp_title">Sending Variable Access Data To An Excel Range</a></li><li><a href="http://datapigtechnologies.com/blog/index.php/passing-multiple-values-to-one-parameter/" rel="bookmark" class="crp_title">Passing Multiple Values to One Parameter</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://datapigtechnologies.com/blog/index.php/using-access-to-combine-multiple-excel-files-method-1/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
	</channel>
</rss>
