4.4 Table Joins Exploring Student Populations Joining Excel Table Data to an Attribute Cherie Aukland Email Sandy Stephenson Email Summary of skills covered: Data needed: Equipment and Software needed: Related book exercise (if applicable): Data Source: Proper format of an Excel Spreadsheet for use in ArcGIS, Joining and Summarizing Tables Properly formatted excel document (supplied) TableJoin geodatbase ArcGIS 10.1 MS Excel Adapted from an exercise : Exploring Student Populations using ArcGIS by Laura Young and Dr. John McGee, Virginia Geospatial Extension Program, http://www.gep.fec.vt.edu Exercise Overview : This tutorial will guide you in creating an interactive ArcMap document from student enrollment data that you can share with college administrators or use as a class project. You will learn how to join locations based on zip code and create a simple map product. What you will need: Computer loaded with ArcGIS Desktop Student Enrollment Data (see below) About 1 hour once your data is prepared Setting up your data: You will need an Excel table with student enrollment data. The table will need, at minimum, a field for zip code and another field of interest: major, term of graduation. Other fields pertaining to characteristics of the student body may also be added. Technical note: Be sure that the field names (and data cells) do not contain spaces. Be sure the Excel file name contains no spaces as well. Save your Excel file in a folder under a root directory on your computer, NOT the My Documents folder. Be sure there are no spaces in any part of the file path name. This is not absolutely necessary, but it can help when using processing tools.
The table below has 5 fields: City, State, Zip Code, Graduation Term, and Primary Major. Privacy note: Be sure that your student data does not contain any unique per- sonal identifiers, including: student name, student street address, student social security number. If the data given to you contains these fields, delete these fields from your data table before pro- ceeding. Overview 1) Download data to working folder and make a connection to the working folder 2) Create a personal geodatabase in the folder 3) Import the excel file into geodatabase 4) Set default geodatabase 5) Add base map 6) Add zip code polygons 7) Add Excel table 8) Summarize the table 9) Join to zip code polygons 10) Symbolize Procedure: 1. First be sure you have your Excel data in a working folder. Then start ArcMap, create a new blank document and save your map document in your working folder with a meaningful name. Open ArcCatalog using the tab on the right side and make a connection to your working folder.
2. Once the connection is visible in the Catalog tree click on the folder name to view the contents on the right. (Figure 2). Now we will create a Personal Geodatabase to store our results. A Personal Geodatabase is like a file folder, but with enhancements that work well in ArcGIS, such as uniform spatial references and many other features. Right-click on the folder name of your new connection under the contents tab and select New -> Personal Geodatabase. (Figure 3). Name your new Geodatabase (In the tutorial, ours will be named StudentData). Figure 2. Connecting to the folder containing student data in ArcCatalog. Be sure you have the Catalog tab selected. Figure 3. Creating a new Personal Geodatabase. 3. Now we will import our Student Data table into our Student Data personal Geodatabase. In ArcCatalog, right-click on the StudentData Geodatabase. Go to Import > Table (single). This will bring up the Table to Table dialog. Under Input Rows, select the file button and navigate to your Excel file (ours is StudentData.xlsx). Hit enter,
then select the worksheet name that contains your data and click Add. Name your Output Table ZipcodeData. Click OK. It may take ArcCatalog a few moments to process. Check your work by double-clicking to open the StudentData Personal Geodatabase and you should now see a table titled ZipcodeData. 4. Now set the default geodatabase by clicking File...Map Document Properties and browse for the StudentData geodatabase: Click OK. The default Geodatabase is important to set, because it is where any operations we perform in ArcMap will be stored. 5. Add base map: We need a base map to give our map a meaningful reference. You can use a base map from ArcGIS Online or your own data. For this exercise we will add the from the UsaData Geodatabase. Open the ArcCatalogue tab, expand the usadata geodatabase and drag in the states feature class.
6. Add zip code polygons : While you are there, drag in the VAZip polygon feature class from the TNCCStudentDemo geodatabase. 7. Add Excel table: Finally drag in the StudentData table from the StudentData geodatabase. 8. Summarize the table: Open your StudentData table and look at the fields. We have one problem: we want to know the number of students in each zip code, but they are listed individually. We will have to Summarize the table by postal code. Summarizing will result in creating a new table that has one row per postal code with a new field called Count_Postal that has the number of original rows (students) per postal code. Right-click the postal field at the top of the table and choose Summarize. Be sure to place your output table in your StudentData geodatabase and give it a meaningful name, I called it SumByZip.
Say yes to adding to the map. Open the new table and review the fields. You will see 9. Join to zip code polygons. Now we can take this table and join it to the zip code polygons and we will be ready to create our map. Since we are joining to the zip code polygons (our destination) right-click VAzip, choose Joins and Relates Join. Be sure you have the following selections. You only need to keep the matching records. Click OK and you can say yes to indexing.
Your VAzip now reflects your join and you can symbolize it. 10. Symbolize: Since you want to show the number of students in each of the zip codes that match, choose a Quantities symbology and a color ramp you l ike. Just accept all the defaults. Right-click VAzip, choose Properties, then the Symbology tab. Be sure Count_Postal is in the value field and you choose a light to dark color ramp.
11. And there it is! Your map showing number of students per zip code in Virginia. If you like you can go to Layout view and choose a layout that shows a legend and a title and make it professional enough to print.