Learn

When we open the Desktop version of Tableau Public, we’ll see a window that allows us to connect to our first data source. As discussed, we can connect to local flat files and Google Sheets with Tableau Public. The two most common files we’ll connect to are Microsoft Excel and .csv files.

In Tableau, Microsoft Excel refers to any file with an .xls or .xlsx extension. Text file refers to a .csv or .txt file. When a Microsoft Excel or Text file is selected, Tableau will only show the files relevant to that selection. Data files loaded into Tableau are also called tables or data sources.

Once we have the data loaded, Tableau will make some helpful changes to the original file. One of these changes is to make the field names more readable, for example changing customer_name to Customer Name. Another thing Tableau will do before we even see the data loaded is assign a data type to each field. This allows us to jump right into the analysis as soon as the data is loaded. In this exercise, we’ll see how to change these names and types ourselves.

Let’s load some data!

Instructions

  1. To start working with data, we recommend that you download the Datasets folder from the Github repository that accompanies this course and save it where you can access it from Tableau. That way, you’ll have all the data you need for the whole course, ready to pull into Tableau. We’ll first work with our version of the Tree Census Data from NYC. NOTE: We’ve removed any columns that weren’t absolutely necessary to help make the large file size a little more manageable – if you notice discrepancies between our dataset (99MB) and the original (236MB), this is why. The original file can be downloaded here if you’d prefer to work with all the columns. Both datasets are a true census, aiming to record data on every tree in New York City! (If you download the original Tree Census (236MB), choose the csv option under the Export tab and save this file in a location on your local computer where you can access it from Tableau.)

  2. Open Tableau Public and select the Text file option in the left pane. This will prompt you to navigate to and open the Tree Census csv file. The next screen we’ll see is one of Tableau’s most useful features: the data viewer. Check out the Tree Census data view and our generalized diagram on the right-hand side of your browser window to get familiar. From this screen in Tableau, we can see a preview of our csv, its metadata (field names), any other data sources we’ve connected to, and can even join data tables with one another.

  3. For now, let’s change a field name to make it clearer for ourselves and other viewers in the future. After taking a look at the Data Dictionary for this dataset, we know that tree_dbh means a tree’s “trunk diameter at breast height,” about 54in or 137cm above the ground. Let’s change that to Trunk Diameter to make it more immediately readable. In either the Metadata or Data Source Preview panels, double click the tree_dbh field name to edit it. Update to Trunk Diameter and press Enter. If you scroll to the right in the data exploration pane, you’ll see that the name has been updated.

  4. Now let’s change a field type. In the Metadata pane, we can see a list of all fields in the data source. (For your reference, we have a table of field types and their corresponding icons below.) To change a type, we just click the icon and select the correct type. Right now, Tableau is treating the Tree Id field as numerical data: a number that we can do math with. It’s actually more accurate to think of that number as a label specific to each tree, though, which would make it categorical data. For this reason, let’s change it from a numeric type to a String by clicking the ABC icon. image of the string icon, letters A, B, C We’ll explore data types in more detail soon so don’t worry if you have questions at this point - we’ll cover different Tableau data types, and why some are blue and some are green. But before we move on…

  5. Let’s save our progress. Since we’re saving on a Tableau Public server, our file will be uploaded to Public rather than saved locally. Click the File menu, and select Save to Tableau Public As... Save to Public If you’re logged in to your Tableau Public account, you’ll be prompted to choose a name. (If you’re not, simply log in through the app or in a browser window.) Once uploaded, a tab in your browser will open with the saved workbook.

  6. Since this is still a work in progress, let’s keep it hidden for now to maintain a clean public portfolio. To do that, click the Settings gear icon at the top of the page. Toggle the Show Viz on Profile option to off. Hidden Toggle When you’re ready to show off this visualization, just toggle this switch back. A hidden workbook will appear with an “unviewable” symbol on your profile. Dashboard Hidden

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?