This is the third in a series of posts on using Tableau Desktop or Tableau Desktop Public Edition to map Connecticut data using custom polygons, to accommodate geographic entities not recognized innately in the Tableau mapping functionality. See these other posts for more information on creating filled maps for Connecticut towns and Census Tracts in Tableau:
- Mapping Connecticut Census Tract data in Tableau
- Creating a custom polygon map for Connecticut towns in Tableau
Tableau and Tableau Public offer robust mapping capabilities, including the ability to recognize geographic entities in your data and instantly create choropleth (filled) maps with shapes for counties, states, and countries. For users that want to create filled maps for geographic entities not recognized innately by the software, Tableau supports the creation of polygon-shaded maps, allowing users to map data onto polygon shapes which correspond to sales regions, marketing areas, etc. The Connecticut State Data Center has created a number of custom polygon map files corresponding to Connecticut geographies not innately supported in Tableau, including Connecticut school districts:
The directions below show you how to connect to this file to create a custom polygon map for school districts, and then join the Polygon data with some sample demographic data from the American Community Survey to create a filled/choropleth map. This is followed by additional tips to joining the polygon shapes with additional data sources, such as data from Connecticut Open Data, CTDataCollaborative, and Connecticut Department of Education.
Step 1: Setting up the School District polygon map:
- Save a copy of the CT_School_District_Polygons_for_Tableau Excel workbook (linked above) to your computer. Open Tableau Public or Desktop, and from the Data menu navigate to the Excel workbook, and drag the Polygons sheet into the data space. Click Go to Worksheet or open a new New Sheet on the task bar.
- Under Measures in the Data pane, drag Longitude to the Columns shelf. Note that the Aggregation for this pill should be average; i.e. the pill should say AVG(Longitude). Aggregations can be changed if necessary (e.g. from Sum to Average) from the carrot menu for the measure in the rows or columns shelf.
- Drag Latitude to the Rows shelf. The aggregation should also be average (AVG) in the pill.
- In the Marks card, change the view type menu from Automatic to Polygon
- If Pointorder was placed in the Measures pane, it must be converted to a Dimension – simply drag it from Measures to Dimensions. Then, drag Pointorder to Path on the Marks card.
- Drag Polygon Number onto Detail on the Marks card.
- Drag District Name from Dimensions onto Color on the Marks card. (If a dialog window appears, confirm that you want to Add all members).
- To see the boundaries of districts more clearly, it is helpful to display borders around the polygons. To do this, click Color on the Marks card, and from the Border carrot menu, select a color. You should now see a map like this:
- At this point, it’s important to note that mapping Connecticut school district data is a little tricky, because the varying administrative structures among districts creates overlapping geographies that makes it impossible to show all districts on a single map. There are three basic administration models for school districts in Connecticut, and geographically speaking, they aren’t mutually exclusive – as many towns send children to more than one district. Here are the three types (the names of the district types are from the Census Bureau (which publishes the shape files from which the polygons are derived); and may not correspond to local or state terminology):