Analytics Roundup: infographics and visualizations
By Chris Gemignani
October 29, 2007
Find more about:
census
design
graphics
mapping
movie
nytimes
video
visualization
zipcode
- Visualization for the Masses: Information Graphics and the New York Times
- He explained how a 30-person team creates the impressive infographics and visualizations we see on the newspaper every week.
- information r/evolution movie
- This video explores the changes in the way we find, store, create, critique & share information, a nice video illustration of some of Shirkey's essays.
- demographics by ZIP Code - ZIPskinny
- Colorful visualization comparing demographic attributes of zip codes.
Mapping Phone Data in Four Easy Steps
By Zach Gemignani
October 12, 2007
Find more about:
googleearth
googlemaps
google
howto
mapping
Have you run into this problem: you have a list of phone numbers and associated values which would be best shown geographically to see patterns, but there isn't a clear way to put the data on a map. Maybe you'd like to see a map of customer service calls by call duration or inbound sales by average order size.
I wanted to share how to MacGyver a solution with a piece of twine, bubble gum, Excel, and a free online map tool. To me, this is a nice testament to the simple but powerful data visualizations that can be accomplished without programming skills or expensive applications.
1. Pull out area codes
First I pulled the area codes from my list of phone numbers using the formula below. This simply checks if the phone number starts with 1, then grabs the appropriate three digits for the area code.
=VALUE(IF(LEFT(E7,1)="1",MID(E7,2,3),MID(E7,1,3)))
2. Convert area codes into states
For my purposes, mapping the phone numbers by state was sufficient. Ideally, we would map the phone numbers to precise latitude and longitude coordinates by doing a reverse lookup of addresses then using the Excel geocoding tool.
First I needed a lookup table that could link my list of area codes to states. I wasn't able to track down a good data table, so I grabbed the data from All Area Codes and cleaned it up. Here is a lookup table of area codes by state.
An aside: I have a pet peeve with people who sell data that feels like it should be publicly available. You'll run across these businesses when looking for basic information about ZIP codes, MSAs, or area codes. Here is an example of one of these parasitic businesses.

3. Create your summary data set
I used a pivot table to summarize metrics by state.
4. Create colorized map of the US
Our friend Ducky Sherwood has generously put together a online tool called Mapeteria that will generate a colorized overlay of US states. In Ducky's words: "Want to make a choropleth thematic map (i.e. coloured based on your data) for Canadian provinces, U.S. states, or French départements?" This overlay can be viewed in either Google Maps or Google Earth.
Here's where it gets a little tricky. You will need to provide Mapeteria with a URL to a properly structured CSV file. Posting a CSV file to a web server isn't trivial if you aren't running your own web site. I found one free service called FileDEN that did the job (other suggestions?). Beware all the advertisingand in all likelihood they immediately sold my e-mail address at registration. Nevertheless, you can upload a file here and it will give you a URL which can be used to create your map.
Here's an example of the results:

5 comments
Tony said:
This is somewhat similar to MS MapPoint with the big difference being this one is FREE!
The difference is this one has a bit more eye-appeal. Maybe it's just the pic, but some of the states in white all blend together. It would be nice to see low-light outlines of the states. Also, what if you don't know your geography too well and need to find Nebraska, but aren't sure which one it is? :)
Also, drill-in functionality would be nice to be able to see within a state what the breakdown is.
Eric Moritz said:
I'm sure you know this but the census.gov provides a zip code to lat-long file here:
http://www.census.gov/tiger/tms/gazetteer/zips.txt
Other zip code data can be found here:
http://www.sdc.ucsb.edu/holdings/zip_codes.txt
Ken said:
Zach,
Nice article. One thing that may have made things quicker for you would be to use the "Get External Data" functionality in Excel on a website like this:
http://www.bennetyee.org/ucsd-pages/area.html
In fact, I used that table to re-create the process in our data browser (screencast here: http://www.kirix.com/blog/2007/10/16/mr-macgyver-meet-strata/).
Keep up the great work!
Bob Chatham said:
Good stuff. I've been using the RegEx 5.5 library to extract area codes, country codes etc. (You need to include a reference in your Excel workbook). Here's a sample VBA function:
----
Public Function regExpMatch(s As Variant, Optional p As Variant, Optional n As Variant) As Variant
'Return the nth match to pattern "p" of a regExp; defaults to 1st match if n is omitted
'If pattern p is omitted, defaults to token: "\s*(?:(\d+)|(\w+)|(.))"
'Return #VALUE error if n is greater than the number of matches
'Return NULL string if no match
'Otherwise, return the matched string
'
'------------- Sample patterns
' Country code of phone number: "^\s*\+\s*(\d+)"
Dim myRegExp As RegExp
Dim myMatches As MatchCollection
Dim myMatch As Match
If IsMissing(n) Then n = 1
If IsMissing(p) Then p = "\s*(?:(\d+)|(\w+)|(.))"
Set myRegExp = New RegExp
myRegExp.IgnoreCase = True
myRegExp.Global = True
myRegExp.Pattern = p
Set myMatches = myRegExp.Execute(s)
If (myMatches.Count = 0) Then
regExpMatch = ""
Exit Function
End If
If (myMatches.Count < n) Then
regExpMatch = CVErr(xlErrValue)
Exit Function
End If
regExpMatch = myMatches(n - 1).Value
End Function
-----
Here's a great free tool that works well with Excel data -- just cut and paste date from Excel into their dialogue box. See tutorial for more options.
http://www.gpsvisualizer.com/
http://www.gpsvisualizer.com/tutorials/waypoints.html
Also, useful geolocation/ZIP tools at:
http://zips.sourceforge.net/#dist_calc
Chris Kennedy said:
Thanks for the article. Check out http://pages.google.com/ for random data-hosting needs (esp. for Google Maps).
Add a comment
Analytics Roundup: Free tools for visualizing
By Chris Gemignani
October 9, 2007
Find more about:
flash
mapping
maps
visualization
- Modest Maps
- Modest Maps is a BSD-licensed display and interaction library for tile-based maps in Adobe Flash 7+, written in ActionScript 2.0.
- glTail.rb - realtime logfile visualization
Analytics Roundup: Visualization goodies
By Chris Gemignani
May 28, 2007
Find more about:
analytics
business
charts
economics
gis
it
management
mapping
powerpoint
presentation
semantics
visualization
- The Problem With Presentations
- Don't let presentation software keep you from getting your story across,
- Webfoot's Mapeteria: Map Colouring
- Want to make a choropleth thematic map (i.e. coloured based on your data) for Canadian provinces, U.S. states, or French départements?
- The Econ 101 Management Method - Joel on Software
- Instead of having smart people figure out how to train their frontline customer service workers to serve customers well and profitably, they make up metrics that sound good and let the low wage, high-turnover customer service people come up with their own.
- The rise and fall of IT | Perspectives | CNET News.com
- Scrap IT? A well-reasoned argument for scrapping the term "IT."
- Gallery of Data Visualization
- Summize - Summarized product reviews
- A nice visualization for showing rankings.
- The Extreme Presentation(tm) Blog: Choosing a good chart
GIS for the rest of us... or Another Excel-based Mapping Tool
By Zach Gemignani
May 17, 2007
Find more about:
geocoding
gis
googleearth
mapping
A client recently asked us if we could help him find the five locations that have the most customers nearby. I dug into the annals of our blog to find two tools that together ("wonder twin powers activate... shape of mini-GIS solution") could solve this problem:
1. Juice geo-coding tool lets you get the precise latitude and longitude for a list of addresses and plot these locations in Google Earth.
2.ZIP code finder lets you enter a US address and returns zip codes within a certain number of miles of that address.
Led by our resident Excel guru David, we combined these features into an Excel tool that lets you answer common location-based questions such as:
- How many libraries are within 10 miles of Worchester, MA?
- Which cities have the most libraries within 10 miles? 20 miles?
- Could I see the library locations on a map, please?
Here's how it works:
1. Drop your location information into the "Geocode data" tab. We are using the Yahoo geocoding service.

2. Go to the results tab and fill in the table with your selected location addresses and distances. Press "Calculate."

Download the Excel file here: Juice Distance Tool
We had a couple other features in mind, but thought it would be better to get some reader reaction before we loaded it up.
This tool is released under the MIT license.
9 comments | Show all comments only the last 5 are shown
Bazily said:
Cool tool. I built a geocoding tool for the web off of Google Maps and Yahoo Geocoding API, hosted here:
http://www.bazily.com/freegeo
It'll do thousands of geocodings in a snap!
Recently I was asked to use that experience to figure the distance between 5,000 retail locations and 30,000 competitors. Awesome.
Hagge said:
Doh.
F-Secure thinks the Excel-file contains an unknown virus.
Hagge said:
I submitted the file for whitelisting, or whatever it is that they do to it, and the next f-secure database-update will fix the erroneous detection.
Chris said:
This is an excellent tool that offers me a quick way to visualize my data. However, the location names do not seem to load into the Google Earth file. I'm using Excel 2003 on XP.
Aran said:
Cool file. I have a long list of zip codes that I would like to experiment with. I wonder if there is a way to tweak the file so that it will geocode a zip code if the other address cells are left blank.
Zach said:
Last I tried, Yahoo's geocoding service (the one baked into this tool) returns a lat/long value for just a zip code.
kelvin said:
This is a GREAT TOOL! but ya, I can't see the site names from the JUICE tool...however, geocode 3.1 xls works, BUT it ends with a debug error after it completes the macro. the end result file provides the site names tho, which is VERY HELPFUL for me! is there a way to plugin the address for each site name/location? that would be ideal.
I use this tool to help me assess the number of apartment complexes in a given area. VERY USEFUL for me to get a quick idea of competition in a particular area i'm looking to invest in!
Jerry said:
Chris (#4) It has nothing to do with Excel 2003. The outputKML macro is referring to wrong column numbers. I changed my Geocode tab to make the Name/Description column into two separate columns & then changed two lines to reflect it:
name = CStr(ActiveSheet.Cells(r, 7))
description = CStr(ActiveSheet.Cells(r, 8))
Jerry said:
If you're behind a firewall, the calls to http.send will fail ....
Function yahooAddressLookup(addr As String, Optional Row As Long) As String
' perform RESTian lookup on Yahoo
Dim response As String
URL = "http://local.yahooapis.com/MapsService/V1/geocode?appid=yahoo_test&location=" & addr
'Create Http object
If IsEmpty(http) Then Set http = CreateObject("WinHttp.WinHttpRequest.5.1")
'Send request To URL
http.Open "GET", URL
http.send
....
....
Only way around it is to add code for http options to work with proxy authentication
Add a comment
Earlier writing


0 comments | Add a comment
said: