
ReadMe URL
Webinar Description
Date/Time: January 12, 11am
Title: Hands-On Tableau Desktop: Mapping the 2016 Presidential Election
Description: Participants of this introductory webinar will gain hands-on experience generating interactive maps and map-centric dashboards using Tableau Desktop. The content we will focus on during this webinar will be 2016 Presidential election results by voter tabulation district in Texas and Census data from the American Community Survey. (Unfortunately, it is too early to obtain 2020 results by VTD. Stayed tuned for future mapping workshops when 2020 data is released.)
- Click to Explore Finished Product

- Download TWBX - Requires Tableau Professional to Use (not Tableau Public)
Participation: Participants can follow along or sit back and watch. To follow along, please install Tableau Desktop prior to the webinar starting.
Presenters:
Tableau Software
Tableau Desktop Software Options Either Tableau Desktop Public (freely available) or Tableau Desktop Professional (fee-based, free to students and teachers) will work perfectly for this webinar.
- Tableau Desktop Public
- Tableau Desktop Professional (student license)
- Tableau Desktop Professional (teacher license)
Webinar Data
Zip Archive of All 3 Files
Data from Texas Legislative Council
- Texas Voter Tabulation District (VTD) Shapefile
- 2016 General Election Data - The election data included in the zip archive has been pre-processed. The complete 2016 election data was filtered and pivoted for Presidential votes and then percent votes were calculated for each candidate.
Data from U.S. Census
- Census American Community Survey (5 year, 2012-2016) - This Census data included in the zip archive has been pre-processed. Data was downloaded for Census Block Groups and approximated to VTD polygons using an area-weighted spatial join approach using ArcGIS.
Webinar Steps
Step #1: Explore 3 Prepared Datasets
- Download Zip Archive of All 3 Files
- Unzip the contents help unzipping
- Explore (preview) the demographics.xlsx file using Excel.
Step #2: Visualize Census Data
- Load demographics.xlsx File into Tableau Desktop
- Launch Tableau (can be either Tableau Public or Professional)
- Click Connect/To a File/Microsoft Excel and browse to the demographics.xlsx file.
- Click the orange Sheet 1 button
- Create Treemap Visualization Showing Income by County
- Select County under Dimensions
- Hold CTRL and select Income under Measures
- Under Show Me on the right, click TreeMap
- This is not correct, is it? Let’s correct the aggregation.
- Click the Undo button at the top left of the screen
- Right-click Income, under Measures, and select Deafult Properties/Aggregation/Average
- Now recreate Treemap
- Change Visualization to Packed Bubbles
- Click the Packed Bubbles button on the Show Me tab
- Drag Income under Measures to the Color box
- Click the Color box and then click Edit Colors to adjust the color scheme.
- Change Visualization to Highlight Table
- Click the Highlight Table icon on the Show Me tab
- Click the Descending button on the top toolbar.
- Rename and Duplicate Sheet 1
- Right-click Sheet 1 and select Rename
- Raname to Highlight Table
- Right-click Highlight Table and select Duplicate
- Rename the new sheet County Map
- Change Visualization to County Map (finally, right?)
- Change visualization to Map (polygons)
- Click the Map button on the Show Me tab
- Click the 99 Unknown tag that appears on the bottom right of the map
- Select Edit Locations
- Under State/Province, select Fixed and then Texas.
- OK
- Change map colors from Income to % Hispanic
- Don’t forget to change aggregation to Average!
- Adjust Basemap Layers
- On the top toolbar, click Map and then Map Layers
- Style can be adjusted
- Individual layers can be adjusted within any style
Step #3: Integrate Election Data
- Load Pres2016.xlsx File
- Explore the pres2016.xlsx table using Excel.
- Click Data Source on the bottom left of the screen
- Click the blue Add button and click Microsoft Excel
- Select the pres2016.xlsx file
- Drag presidential to the window next to demographics. This should automatically connect to the demographics table and the Edit Relationship window will appear.
- The default Cntyvtd will connect to the Cntyvtd1 column.
- Click the County Map tab
- Now both tables are available.
- View % Votes for Trump in 2016 by County
- Aggregation fix is necessary again!
- Drag Trump to Color Box.
Step #4: Integrate VTD Boundaries
- Load VTDs.shp Shapefile
- Click Data Source on the bottom left of the screen
- Click the blue Add button and click Spatial file
- Browse and select the VTDs.shp shapefile
- Drag VTDs to the window next to demographics.
- The default relationship is perfect
- Create a New Sheet
- Rename the New Sheet VTD Map
- Map Data Using VTD Boundaries
- In the Table of Contents on the left, double-click Geometry under VTDs.
- Drag CNTYVTD to the Detail Box
- Drag % Votes for Clinton to the Color Box
- Remove polygon booundaries to view urban VTDs
- Click the Color Box
- Change Border to None
- Add Filter for County
- Right-click County under the demographics table and select Show Filter
- Hide the Show Me tab if visible
- Under the County filter options, select Multiple Values Dropdown
OPTIONAL Step #5: Dynamic Dropdown to Adjust Color
- Create a new Parameter to hold color background choices
- Name the Parameter Choose Variable
- Data Type: String
- Allowable Values: List
- Under List of Values, enter Income, % Clinton, % Trump
- OK
- From the new Parameters list on the bottom left, right-click Choose Variable and click Show Parameter
- Create a new Calculated Field to hold values of selection
- Name the Calculated Field Variable Placeholder
- Formula:
IF [Choose Variable]="Income" THEN [Income]
ELSEIF [Choose Variable]="% Clinton" THEN [Clinton]
ELSEIF [Choose Variable]="% Trump" THEN [Trump]
END
- Drag Variable Placeholder to the Color Box
- Nice, huh?
- Navigate to the Highlight Table sheet
- Set default aggregation for Variable Placeholder to Average
- Drag Value Placeholder to the Color Box
- Navigate to the County Map
- Drag Value Placeholder to the Color Box
Step #6: Create & Publish Dashboard
- Set the Page Size
- Click the New Dashboard icon
- Under Size click the size suggested
- Change Fixed to Automatic
- Drag Sheets to arrange as you see fit
- Set the County filter to Apply to Worksheets/All
- Publish Steps - If Using Tableau Professional
- CLick Data/demographics/Extract Data
- Click Extract
- Click Server/Tableau Public/Save to Tableau Public
- Publish Steps - If Using Tableau Public
- Click File/Save to Tableau Pubic