The Journey of Writing a Tableau Book

TwitterFacebookGoogle+Share

A few years ago, a colleague of mine sent out an email asking if anyone was interested in serving as a technical reviewer for a Tableau book.  I was becoming quite involved as a helper in the Tableau forums and so I jumped at the opportunity.  Reviewing was a fun process of reading initial drafts and making comments and suggestions.

Then, about this time last year, the publisher contacted me and asked if I’d like to write a Tableau book. After discussing with my wife, I embarked on a journey – one which involved more effort and reward than I ever imagined.  The title Learning Tableau, selected by the publisher, is far more appropriate than I had first thought.  Not only does it express my hope that readers will learn to use Tableau effectively to gain insights into their data, but it was a process of learning for me too.

Learning Tableau by Joshua N. Milligan

My Goals

Very early on in the process, Shawn Wallwork (see his Tableau blog here), who graciously agreed to serve as a technical reviewer, asked me what my goals were in writing a Tableau book.  It was an opportunity for me to examine my motives.  Was it fortune?  Fame?  Well, fortune didn’t seem likely as most technical books don’t sell a very high number of copies.  Fame also seems to be elusive for the technical writer.

Instead, I clarified my thoughts with these goals:

  • Grow and learn. Not only in my understanding of Tableau but also in my ability to teach, mentor, and present concepts clearly and meaningfully.
  • Help Others. I wanted to write a book that would help others in their Tableau journey.  I told Shawn that ultimately I wanted to write the go-to book for the Tableau community.

And what I meant when I told Shawn that was that I wanted to write a book that would give readers the foundational concepts necessary to understand how and why Tableau fundamentally works– the underlying paradigm – and how to think “in Tableau”.  It wouldn’t just give a set of steps to memorize nor would it be a dry reference guide of concepts.  Instead it would be a blend of practical examples and fundamental understanding.  It would then build toward some advanced concepts and leave the reader with a solid foundation on which they could continue to build.

 

The Challenge and the Help

When I agreed to write the book, I never anticipated how challenging it would be.  I love Tableau training and mentoring.  When I teach a Tableau class, nothing is more rewarding than seeing my students light up with understanding.  But when something isn’t clear for a student, they raise their hand and ask the question.  When I answer a question on the Tableau forums, I usually get a response of “right”, “wrong”, or “kind of, but…” within a day or two.  When I sit down with a business analyst or executive to iteratively build visualizations and ask and answer questions there is immediate feedback.  If something doesn’t look right it gets fixed on the spot.

But a book is different type of training experience.  The author doesn’t receive immediate feedback.  The reader won’t see the written words for months and if there is a mistake, a mis-statement, or an unclear passage it will be too late to correct it after it is published

That’s where the technical reviewers step in.  I had four: David Baldwin, Sagar Kapoor, Joshua Kennedy, and Shawn Wallwork.  The reviewers would go through each draft of the chapter offering suggestions, corrections, encouragement, and other helpful feedback, like this early iteration:

Technical Reviewers' Suggestions

I never knew how much of a team effort writing a book really is.  I am forever in the debt of the reviewers.  Indeed, without the reviewers, publishers, editors, and many others, the book would not have been possible.

The Reward

I also never imagined how rewarding the end-result would be.  I love helping and empowering people with Tableau.  Most of the time the feedback is immediate and very gratifying.  On the other hand, writing a book is mostly a process of imagining how helpful each chapter will be.  And in the middle of typing page after page and building out sample data sets and workbooks, there were times when I was ready to be done.

But now the writing is done, the book is published, and people have started to read it.  And the feedback from readers and the Tableau community has been overwhelmingly positive.  I have received notes, reviews, emails, and personal thanks from many who have found the book to be helpful in their understanding of Tableau.  I am deeply thankful to everyone who has offered support and encouragement at every step along this journey.

 

My very first time autographing Learning Tableau
My very first time autographing Learning Tableau

Star Trek – To Boldly Tableau

You’ve seen Choose Your Own Adventure, Tic Tac Tableau, and Blackjack!

(By the way, ever wonder why I create these games in Tableau?  Here’s the answer!)

Now, prepare yourself for the next generation of Tableau Games:

It's coming...

When will it be here? You’ll just have to check back every day, orSubscribe to make sure you are the first to play.

And please make sure you don’t wear your red shirt.

Life before Tableau 9 Level of Detail Calculations

Over the next few weeks, leading up to the Tableau Think Data Thursday presentation (register now!), I’ll take a look at some fun facts about Tableau 9 Level of Detail calculations.  Today, let’s take a look at life before LOD calcs:

Back in My DayIn versions prior to Tableau 9.0, Level of Detail (LOD) calculations were not available.  That meant that there were only a few ways to effectively work with different levels of detail in the same view:

  1. Table calculations
  2. Data Blending
  3. Sets
  4. Grand/Sub Totals

All of these had potential draw-backs.

 Table calculations are relatively easy when you want to work at higher levels of detail in a view (essentially the equivalent of EXCLUDE), but much more cumbersome when working with lower levels (essentially an INCLUDE or FIXED), because you’d have to include dimensions for the lower level of detail in the view and then hide using some kind of First(), Index() or Last() filter to hide the lower level of detail.  You can see the difference here: Charting new distinct values per period?

Data blending was often the most effective, because you could control the level of detail for the blend – however, you could run into issues when using DB2 (data blending with fields from the primary source not present in the view) because certain calculations (such as COUNTD) were not allowed.  You’d also have to maintain multiple copies of the data source.

Sets were very effective when you needed to work with a level of detail of a single dimension.  But you could only get IN/OUT of the set and you couldn’t use multiple dimensions for a computed set.  So, you could get a set of every customer with a first purchase in 2014.  But you couldn’t get the first year of purchase per customer at a row level.

Totals represent a higher level of detail within a view and there are some work-arounds to customize them — but there’s not a lot of flexibility.

Tableau 9.0 Level of Detail calcs are a real game-changer and Tableau 9 opens up a lot of possibilities for answering questions that would have previously required quite a bit of complexity.

How have LOD calcs changed the game for you? Let me know in the comments.  Stay tuned… there’s more to come!

Dates in Tableau make me want to tear my hair out!

“And tear out my beard and uncover my head!” -Tevye
“And tear out my beard and uncover my head!” -Tevye

 

Actually, it’s not dates in Tableau.  Tableau does wonders with dates!  What other tool allows you to connect to a data source with dates and have a built-in hierarchy where you can move different parts of the hierarchy around in the view?  What other tool has its own built-in date dimension?  There are imitators – but Tableau did it first.

(That’s not to say there isn’t room for improvement)

 

But it isn’t dates or using dates in Tableau that drives me nuts.  So, what is it? It’s the way people have been taught to think of dates in Tableau.  It drives me nuts, because ultimately it drives them nuts and they get frustrated and complain and think Tableau is hard and needlessly complex.

But it’s not Tableau – it’s the way they’ve been taught or the way they’ve made assumptions.  And actually, it goes deeper than dates.  It starts with dimensions vs. measures, and discrete (blue) vs. continuous (green).

 

Dimensions, Measures, Discrete, and Continuous

Here’s the issue: in an attempt to keep things simple in explanation, accuracy was sacrificed.  Consider the following:

Wrong

 

Here’s what I think when I see that:

No!  A thousand times, no!
No! A thousand times, no!

 

To say dimensions are discrete and measures are continuous is a simplification.  Simplification can be good.  But not when it’s just flat out wrong.  It might appear to be helpful, but really lays a poor foundation of understanding that will limit people from moving forward.

Consider this view:

View with Discrete Measure

Not only can I see the number of habitable planets for the Klingons, Romulans, and Federation, but I can also quickly see a count of Neutral Zone Violations as headers in front of the bars.  I can do this using a Discrete (Blue) Measure. Yes: it is a measure.  Yes: it is discrete.  Let that sink in.

It. Is. A. Discrete. Measure.

I made it discrete using the drop down menu on the field:

Discrete and Continuous Options

If I didn’t know I could use a measure as a discrete field in the view, then I might have moved the continuous field all over the place, searching for the perfect view (but never finding it):

never finding the right view

 

So, let’s keep it simple.  But let’s also keep it accurate:

  • Measure: a field that is aggregated (e.g. summed up, averaged, counted, etc…).   For example, I can sum up all my Habitable Planets, take an average, or get the minimum or maximum.

vs.

  • Dimension: a field that slices or groups the measures.  For example, I want to get the sum of Habitable Planets and the sum of Neutral Zone Violations sliced up by Alignment.  Since there are 3 alignments, I’ll get 3 sums (SUM of Habitable Planets and SUM of Neutral Zone Violations for Klingons, for Romulans, and for Federation)

 

Now, contrast that with:

 

  • Discrete (blue): Individual Values – when a field is used as a discrete field in the view, it will define headers and color legends with individual values.

vs.

  • Continuous (green): A  Flowing Range of Values – when a field is used as a continuous field in the view, it will define axes and color legends with gradients:

 

Discrete (blue) fields in action:

Discrete field in action

Continuous (green) fields in action:

Continuous field in Action

 

There’s some complexity we could dive into.  But we can keep it simple – and without sacrificing accuracy.  Here’s the simple thing to remember:

 

Measure vs. Dimension determines what fields are being aggregated and what fields are slicing/grouping the aggregations.

Discrete vs. Continuous determines how Tableau draws the results (headers, axes, color legends, etc…)

 

And here’s the secret:

For the most part it doesn’t matter whether a field is in the Dimensions list or the Measures list in the left Data Window.  That’s just the default, but once the fields in the view, you can use the drop down to convert almost any field back and forth between Measure and Dimension and between Discrete and Continuous:

Options

 

In summary: Almost any field in the view can be used as either a Dimension or a Measure.  And numeric and date fields can also be used as either Discrete or Continuous. 

 

And with that, you’re on your way to becoming a Tableau Jedi.

Then I am a Jedi
“Then I am a Tableau Jedi.” “No. Not yet. One thing remains. Dates. You must confront dates.”

 

 

Dates in Tableau are not hard…

…at least not if you take some time to understand and use careful, precise terminology.  When you right-click a date field in the view in Tableau, or use the drop-down you’ll get a menu like this:

Date Menu

 

Now admittedly, this is a long list and it might be intimidating at first.  But let’s break it down.  There’s:

  • The standard options for a field (Format…, Show Header, and at the bottom: the Tableau 9.0 feature – Edit in Shelf, and Remove)
  • Show Missing Values
  • A section of Date Parts
  • A section of Date Values
  • Exact Date
  • A section that allows you to switch between Attribute and various Measure aggregations
  • A section that allows you to switch between Discrete and Continuous

We’ll skip the standard options and merely mention, for now, that Show Missing Values is simply a way of telling Tableau to include missing dates in a visualization so you can see gaps in time where there is no data.

And just like almost any field, we can use it in the view as a dimension or a measure.  And we can use it as discrete (blue) or continuous (green).

 

The two primary sections that need to be understood are the two sections of dates.  The first section is a list of Date Parts. The second section is a list of Date Values.

 

Date Parts

Date Parts

Date parts are just the individual parts of a date – all by themselves.  So a date of November 8, 1980 could be broken down into individual parts:

  • Month: November
  • Day: 8
  • Year: 1980

And when I use just one of those parts as a dimension in a viz, then I’m telling Tableau, “Aggregate all the measures at the level of that date part.”  So, for example, when I put a Date on Columns and then select the Date Part of Month, I might get a view like this:

November

 

I’m telling Tableau, give me the SUM of sales for each Month (as a date part).  Sales on November 8, 1980 are included in the bar above.  So are Sales on November 9, 1980.  And November 22, 2015.  Sales in any November are included.

If I had selected the Date Part of Day then I would have a bar chart of every day (1st through 31st).  The 8th would have been any 8th of a Month: November 8, 1980; December 8, 2015; February 8, 2025.

 

Now, some people have been taught to refer to Date Parts as “Discrete Dates”.  This is because when you select a Date Part for a date field, the default is a discrete (blue) field.  But it is not accurate to speak of Date Parts as “Discrete Dates”.  You can switch a Date Part between Discrete and Continuous.  Here’s that view from above after using the field’s menu to make the switch:

Continuous Date Parts

 

Sure, the way Tableau drew the view changed (an Axis instead of headers, formatting the month as a numeric value, making the bars narrower, faint grid lines) – but fundamentally, it’s still giving the SUM of Sales for all Novembers (and Januarys and Februarys, etc…).

Don’t think of Date Parts as “Discrete Dates”.  They are “discrete by default’, but the Tableau Jedi can merely wave his hand (or use the right-click menu) and change things as desired.

“You want to be continuous”   “I want to be continuous”
“You want to be continuous” “I want to be continuous”

 

Date Values

Date Values

Date values are indeed the value of the date.  Notice that it isn’t just November.  It isn’t just 8.  It’s November 8, 1980.  Or, it’s November 1980.  It depends on the level you select.

So take that date and assume it has time included: November 8, 1980 5:46am

Depending on what level of detail you select you’ll get a value that is truncated (lower levels of details getting cut off).  Let’s rearrange the date and pretend we’re building a bar chart so we can see it better:

Year Month Day Hour Minute Second

1980 November 8 05 46 00

  • Year: 1980 November 8 05 46 00 – Truncated to the Year. Any date that falls within 1980 will give us a single bar.  There will be a bar of every other Year in the data.
  • Quarter: 1980 Q3 November 8 05 46 00 – Truncated to the Quarter. Any date that falls within 1980 Q3 will give us a single bar.
  • Month: 1980 November 8 05 46 00 – Truncated to the Month.  Any date that falls within November 1980 will give us a single bar.  Notice we get a bar for each Month and Year.  Notice also that I’ve made the field discrete in the view, which gives headers.
    Date Value Bar Chart
  • Date: 1980 November 8 05 46 00
  • Hour: 1980 November 8 05 46 00
  • Minute: 1980 November 8 05 46 00
  • Second: 1980 November 8 05 46 00

Again, some people have been taught that these are “continuous dates.”  They are not.  They are continuous by default.  But you can change them as needed.

Exact Date

Not much to say, except that this is the exact date value in the data.  No truncation, no funny business.  Just the exact date to whatever precision the data contains (including time if applicable).  This one can also be either discrete or continuous (it is continuous by default).

 

Why it Matters

Because you will no longer get frustrated and wonder why dates are so hard and confusing.  They’re not – not really.  And you will be able to generate some really cool views and impress your friends and co-workers.  You’ll select date parts or values as needed and change them to discrete or continuous at will.  You will be a Tableau Jedi.

Qui Gon prefers Continuous while Obi Wan likes Discrete.  I prefer Episodes 4 - 6.
Qui Gon prefers Continuous while Obi Wan likes Discrete. I prefer Episodes 4 – 6.

 

 

Convert Tableau to PowerPoint

Today’s Tableau Tip comes from my colleague, David Baldwin.  I am privilleged to work with him at Teknion Data Solutions, a Tableau Gold Partner providing data consulting solutions.

David is also Tableau Trainer – travelling the country to teach others how to use Tableau to see and understand their data.  One of the questions he often gets is how to convert Tableau into PowerPoint presentations.  

powerpoint

Here’s David’s answer:


How to Convert Tableau to PowerPoint

Let’s face it.  PowerPoint is ubiquitous and many companies have policies requiring PowerPoint for presentations.  Rats!  Wouldn’t be so much cooler to put a complete presentation in Tableau including not only data visualizations but images, lines of text and even animation?  Alas! Sometimes we have to bow to cultural dictates and put static screenshots of interactive visualizations into a pptx file.

How does one best do this?  Below is one approach where, admittedly, I thumb my nose a bit at PowerPoint by starting from a Tableau workbook that has been designed as a “PowerPoint-like” presentation.

  1. Open attached workbook “Fundamentals.twbx”.
  2. Select File > Print to PDF.
  3. Choose “Entire Worksheet” and set the orientation to “Landscape”
    Print to PDF
  4. Open the resulting PDF in Adobe Acrobat Pro.
  5. Within Adobe Acrobat Pro choose File > Save as Other > Microsoft PowerPoint Presentation.
    .
    Note that this selection choice is not available in Adobe Acrobat Standard. Alternatively, you might experiment with other PDF software packages such as Nitro or Foxit.  If you do come across a good “free” solution – please tell me in the comments.
  6. Presto!  You have a PowerPoint presentation!  However, we’re not done yet.
  7. Note in the attached pptx file that the first page is a mess.  There’s not a whole lot we can do to fix this.  The fastest choice is to just take a screenshot of the first dashboard in the twbx file.  The cleaner approach (which may be important if you plan to print the pptx file) is to recreate the page within PowerPoint.
  8. Notice that the pages have artifacts on them.  Fortunately, these artifacts are relatively easy to clean up.
    Artifacts
  9. To clean up artifacts, within PowerPoint go to View > Slide Master.
  10. Within each Master Slide remove the offending artifacts.  (See below.)
  11. With just a little more cleanup work, you should be good to go!

You can download David’s files here.  

Want to see what else you can do with printing and PDF?  Check this out.

Also, don’t miss any tips – pleaseSubscribe!

Going Off Grid – The secret way to hide something on a Tableau Dashboard

Wouldn’t it be great if there was a way to hide something on a Tableau Dashboard?  Something you, the designer wanted to see, but not something the end-user of the published dashboard should see.

Maybe it’s a set of instructions to remind yourself of how quick filters and parameters should be set prior to publishing.  Maybe it’s a drop down control for your action filter(s) so you can see what actions have been triggered and easily reset the action.  Maybe it’s an email message from the private account of a government official that you want to keep from the prying eyes of the public.

Whatever the case, there is a way!

The secret place to hide things on a Tableau DashboardClick to enlarge image

You can place any dashboard item just off the dashboard (in a fixed size dashboard) and when it’s published, the end-user will never see it.

How to get the dashboard item to the hidden place

The only trick is how to get something off the dashboard.  If you drag it there you get nothing.  Or if it was already on the dashboard, dragging it off is the same thing as removing it.

So instead, place it on the “real dashboard” as a floating item.  Then use the Position controls in the lower left to set the X and Y coordinates to position it off the dashboard.

Position Controls

 

The end result is a published dashboard that hides all the elements that were off the dashboard.

I sure wish I’d known this technique when I developed the Choose Your Own Adventure or BlackJack! dashboards.  Then, I created a secondary dashboard with everything on it and a special action filter to “reset” the dashboard as I designed and tested.  Instead, I could have just hidden the action filters off-grid and reset as desired.

Check out the dashboard in action:

All the hidden items I added to the dashboard are there, but in order to see all my secrets you’ll have to download the workbook and open it in Desktop…

Like this tip? Please leave a comment – I’d love to hear your feedback. Also look for the Share and Subscribe links if you’d like to keep up with the tips and share the knowledge! Until next time…

Data Prep and the New Tableau 9 Data Interpreter

The Tableau 9 Data Interpreter and other new data prep options, such as pivot and split, open up new possibilities for connecting to data.  No longer will you have to spend all your time fixing data structure and cleaning up headers, footers, and merged cells in Excel.  Tableau 9.0 makes that (and more) so much easier so you can get to asking and answering questions and visualizing the data!


Want to learn more about Tableau 9.0 features? Check out my favorite feature and some of my other favorites.


 

 

The video below is first in a series I will be doing for Teknion Data Solutions. In this video I’ll demonstrate the new data preparation features of Tableau 9, including the new data interpreter.

<shameless plug> I have been working as a consultant with Teknion Data Solutionsfor over 10 years and love it! If you enjoy Tableau (or any aspect of BI) and love to help others, consider joining Teknion’s team of consultants. </shameless plug>

I had a great time presenting this feature and others at DFW TUG! What a turn out!  Thanks to everyone who came and for those who made it come together.  If you were there (or even not) and have any additional questions leave a comment on this post and I’ll gladly try to answer.  I also presented on other new Tableau 9.0 features, including:

  • New Data Connection Options (Pivot, Split, Data Interpreter)
  • Level of Detail (LOD) calculations
  • Regular Expressions
  • New Calculation Editor & Ad  Hoc Calculations
  • Drag and Drop Analytics
  • Fun and Useful Enhancements (color picker, thumbnail preview, map search, new selection options)
  • Tableau Server Updates

And, now, the video:

(Subscribe to Teknion’s YouTube channel to get updates as new videos are posted)

One Trick to Hide Titles in Tableau

Sometimes you want to customize titles or even hide titles in Tableau.   When shown on a dashboard, titles will always appear, even when you filter out all the data in the view:

The Title is not hidden, but stays when data is filtered.

Notice how the  title stays, even when all the data is filtered and the view isn’t drawn.   This can be unsightly, especially in dashboards where I want to guide the user through some exploration.  Who wants to see titles of things that aren’t meant to be seen until you take an action?

 

One way to hide titles in Tableau

1. Create a calculated field with hard-coded string:

Customizing a Title with a CalculationI used the aggregation of MIN here to force it to be an aggregation to avoid it interfering with table calcs. (I also suspect that this is would be more performant than a row-level calculation in most cases, but I’m not sure. If you know, please leave a comment…)

2. Place the resulting calculated field on Columns to give you a custom “title” at the top of the view.

3. On the dashboard, you can hide the real title so that everything disappears when there is no data:

Custom Title that will be hidden

That’s not really a “title” it’s just a column header with some formatting.  Here are the steps I took to get it to look like a title:

  • Right-click the column header and select Format
  • Change the font size
  • Switch to Borders on the format window and adjust the level of Column Headers.

And now, the title is hidden when the view has no data!Title is hidden!

That’s it for this Tableau tip.  There’ll be more soon.  Subscribe to keep up-to-date!

Tableau Mapping Tip: Geographic Drill Down

Tableau Tip Tuesday

Previously,  we saw how to capture and use Tableau’s automatically generated latitude and longitude for custom geocoding.  Now, we’ll extend that technique to give us the ability to drill up and down on various levels of geographic detail in a single visualization:

Drilling down and up again on geographic levels of detail.
Drilling down and up again on geographic levels of detail.

 

The data is fairly standard.  We have Regions which contain 2 or 3 Areas which contain multiple Zip Codes:

The data

Only Zip Code is recognized as a standard geographic field.  Tableau is nice enough to supply the fields Latitude (generated) and Longitude (generated) based on the Zip code.  However, we can’t use those fields in calculations or blending.  So, we’ll capture them in a separate data source (along with the associated Region, Area, and Zip Code) just like we saw in the previous tip.

Data Blending to Control the Level of Detail

Now we can blend between the two sources on any of the fields they share in common:

We can blend on Area, Region, and/or Zip Code to control the level of detail.  The AVG Lat and Lon from this data source will give us the geographic center of the level of detail in the blend.
We can blend on Area, Region, and/or Zip Code to control the level of detail. The AVG Lat and Lon from this data source will give us the geographic center of the level of detail in the blend.

 

But why set the level of detail of the blend ahead of time?  This gets much more exciting if we create a parameter and a couple of calculated fields to allow the end-user to control the level of detail of the blend.

Here the parameter:

Parameter
We’ll let the user select Region, Area or Zip code. Typically, I’ll use an integer parameter with the Display As text. It’s more efficiently calculated and if I want to change the display, I don’t have to go change a bunch of calculated fields.

Then, I’ll create a calculated field that returns the desired dimension based on the parameter selection:

Calculation

We’ll create this calculation in both the primary and secondary data sources.  Why?  So we can blend on that field instead of any of the others:

Blending with Parameter

 

And now, the level of detail of the blend changes with the user selection.  Instant geographic drill down (and up again!)

Here it is in action:

Poor Man’s Custom Geocoding in Tableau (Part 2)

Tableau Tip Tuesday

Last time we looked at a simple way to implement custom geocoding in Tableau using the ability to assign latitude and longitude to unknown locations.  That’s a fairly good option if you only have a few locaitons and only need to plot marks on a map or two in a single workbook.  But what happens if you have a lot of locations?  Or what if you want to reuse the solution in multiple workbooks?

There is a way!  We’ll use the tried and true Superstore sample data to illustrate.

This data set includes some fields with recognized geographic roles such as City, State, and Postal Code (Zip), but it also includes a Region field that does not have a geographic role.  Now, this is purely an example and this data set only has 4 regions — so it wouldn’t be too difficult to lookup latitudes and longitudes and plug them into Tableau like we saw last week.

(by the way, Shawn Wallwork got me to thinking and I realized you don’t need to leave Tableau and go to Google to find out the lat/lon for a coordinate on a map.  Just right-click the map and add a point annotation then Include latitude and longitude to see where that point is.)

But what if you had ten regions?  Or 15 territories?  And what if you want to reuse the results in more than one workbook?

Well, the good thing is, Tableau is ready to help!  We just have to coax it a little…

Get the Data Set with Latitudes and Longitudes

I’ll start by creating a geographic view that includes Region but also a few other geographic fields so Tableau will use the Latitude and Longitude fields it automatically generates:

Region with Zip Codes

Here I have a mark for each Postal Code (Zip code) color coded by Region.  You’ll notice that Regions contain multiple zip codes and a single zip code is contained in only one region.  This data is really clean — but this technique will work even if the data isn’t quite so nice.   Just have some kind of geographic relationship.

Here’s the trick — we’re going to capture Tableau’s values for latitude and longitude — along with the associated Region and then create another data source with that data.

I press Ctrl + A to select all the marks on the map (or Area select them) and then right-click a mark and select “View Data”.  And there it is, the data set I want!

Lat and Lon for all Zip Codes and Regions
Lat and Lon for all Zip Codes and Regions

Now I have every zip code within a region along with the associated Latitude and Longitude.  Now, simply press Ctrl + A to select all rows, then Copy, then close the dialog box, then Ctrl + V to paste back into Tableau as a new data source!

New Data Source In Tableau

And now, the magic:

Use Data Blending to use the Latitudes and Longitudes

We’ll start a new sheet with our original data set and put Region on the Marks card to define the level of detail.  Then, we’ll switch to our new data source and bring out Latitude and Longitude to Rows and Columns.  We’ll use an aggregation of AVG for both.  Guess what? When we blend on Region, that’s the geographic center of all the zip codes within that Region!

Finished

And there you have it!  You now have an easy way to plot marks for any number of regions or territories or unknown geographic field based on the geographic center of a known geographic fields.

Like it?  Let me know in the comments and also check back next week for one more step that makes this even more exciting!

Tableau Tips and Tricks ● Story Telling ● Beautiful Data Visualizations