COFHE-IR Tableau Training I Marin Clarkberg and Deb Fyler, Cornell University Session I: Tableau Basics April 7, 2013 http://irp.dpb.cornell.edu/cofhe-chicago What is Tableau? Tableau is a “business intelligence” tool useful for making “interactive data visualizations.” According to Wikipedia, Tableau “traces its roots to academic research in Stanford University’s Department of Computer Science between 1997 and 2002.” It is not a spreadsheet; you do not use it to enter or edit data. It is not a statistical package; you cannot run a regression. It is a very efficient way to produce mountains of beautiful bar charts. It is a great tool for putting data on a website so that selected others can find the data they need, even when their needs are somewhat unique. Why Tableau? Interactive data visualizations can greatly reduce the need for IR staff to produce endless variations of reports (e.g. a report for each department) Sophisticated Tableau reports can be designed by existing IR staff who know the data well and understand executive reporting needs… but who are not IT experts Tableau is beautiful. Not only are the visualizations elegant, but it is easy to place reports into a webpage so that users do not have to access a special portal or receive special training. If you spend the money, you can have total control over who sees what kinds of reports. It’s easy to set up repositories of information that can be accessed by different groups (e.g. the public; IR staff; the group of academic deans; etc.) Examples of Tableau Cornell IRP public Factbook: A handful of Tableau visualizations have replaced scores of individual difficult-to-navigate PDFs. (Supported by Tableau Public Premium.) Cornell Strategic Metrics: A compilation of cross-functional data from many sources pulled together into one set of dashboards. (Supported by Tableau Public Premium.) Executive Diversity Dashboard: Sensitive information available to a selected group of executives and diversity professionals. (Supported by Tableau Server.) Salary analyses for the academic deans: Highly sensitive information available to one dean and not the others. (Supported by Tableau Server.) Ad hoc reporting: Tableau server gives you a place to put stuff (Supported by Tableau Server.) clarkberg@cornell.edu djf5@cornell.edu 1 Vocabulary Workbook. A Tableau document with the suffix .twb. It may contain worksheets and dashboards. o A packaged workbook, .twbx, is a Tableau workbook integrated with the data source and compressed. Worksheet. Like in Excel, one ‘tab’ within a workbook. Dashboard. Also a ‘tab’ within a workbook, a dashboard is a presentation space for one or more worksheets. It may be linked to multiple or many datasets. Data. As with SPSS or another statistical software package, the data is generally a separate, independent file. In Tableau, we start by “connecting” to a data file, such as a .xls file or a .csv file. Data Extract. Sort of similar with the .sav file with SPSS, you can save the data in a format that will improve the performance of Tableau. This is a data “extract”, .tde. Viz. The hip Tableau way to say “graph” or “chart.” Getting Ready 1. Get your data into shape: Format as raw data (Tableau can manage aggregations and calculated fields) Single first row as a header with column names Make each row a single ‘instance’ (single person, single class enrollment) clarkberg@cornell.edu djf5@cornell.edu 2 2. Open Tableau Select ‘Connect to Data’ and ‘Text File’ and migrate to the dataset. We most often use simple .csv text files or Excel (.xls preferred; .xlsx is sort of a pain). Workbooks can contain multiple connections to data sources. Further, within Tableau you can create “joins” like you might do using a database query tool. The Excel file we prepared has two spreadsheets. For now, we’ll stick with one thing at a time: just select ‘Class Size TEST’( .xls). clarkberg@cornell.edu djf5@cornell.edu 3 When you ‘Connect live’ the data will be refreshed whenever you open the workbook. This is useful if you expect that the file you are connecting to will change, but it can be slow if you are working with a large dataset. ‘Import all data’ will create a Tableau Extract (.tde file). Tableau extracts are optimized for the software to run very quickly. You can still refresh a data extract, but it is an extra step. Since this is a small data set, let’s “Connect live.”At last, we are in Tableau; it should look something like this: Question: Where are the data? Answer: Tableau connects to the data, but you won’t really edit it within Tableau. If you want to see the data, you can click on the little grid icon, here: clarkberg@cornell.edu djf5@cornell.edu 4 You can create new calculations and aggregations within Tableau, but you don’t fundamentally alter the underlying data to which you have connected. Notice the column headings in the Excel spreadsheet have been sorted into Dimensions (like “Academic Term Sdescr”) and Measures (like “Class Enroll Tot”). Vocabulary Dimensions. Roughly speaking, these tend to be categorical variables that you might want to use to break the data into groups (e.g. sex, race, major). You could also think of dimensions as your “independent variables.” Tableau starts by assuming that all your non-numeric data is data that might want to use for breakouts. You are not stuck with this designation. Measures. Tableau starts by assuming that all numeric data is something that you might want to sum, average, or trend. You might think of measures as your “outcomes” or “dependent variables.” Of course it is not always appropriate to take an average of a variable stored numerically (like, say, race stored as numeric codes). Therefore, you may want to change some of your “measures” into “dimensions”… a very easy task: just drag them. In our case, several of the numeric fields or variables are really “dimensions”; they can be dragged from Measures to Dimensions. 3. Arrange your variables into Dimensions and Measures as appropriate. In our example, you have something that looks more like: clarkberg@cornell.edu djf5@cornell.edu 5 Making a Table Vocabulary Shelf. You will use the “Columns” shelf and the “Rows” shelf in Tableau. Card. Cards are just containers for the controls in Tableau. You will see the “Pages” card, the “Marks” card, the “Filters” card and so forth. Pills. The little blue and green rounded rectangles that contain the names of your variables are called pills. For example, you might refer to the “Ssr Component” pill or the “student id” pill. Blue pills are dimensions; green pills are measures. 1. Drag one of your dimensions onto the Rows Shelf 2. Drag one of your measures into the cells (where Abc is shown, above): clarkberg@cornell.edu djf5@cornell.edu 6 Making a Graph 1. Select the blue horizontal bars on the “Show Me” Wizard. 2. If you prefer a line graph, choose Line from the Marks “card”. 3. If you want to reorient your line graph, use the transpose function at the top of the window: If you don’t like it…. Right-click on it. Many features in Tableau are easily accessed by right-clicking. Go back. The “back” arrow in the upper left (right under File) will “undo.” You can use it to undo a whole string of stuff. clarkberg@cornell.edu djf5@cornell.edu 7 Getting Rolling Back button/right clicking Make an extract Duplicate a field Rename a field (Units) Do a calc function (Subj Cat Num, Count of Class, Foundation Course Foundation courses are CHEM-2080, 2090, 2510, 3580 Create a group (Class Enroll Tot (group)) Create a hierarchy (Foundation- Sub-Comp) Field Properties (Ssr Component) o Do a sort o Aliases Duplicate Sheet Make it interactive: Quick filters clarkberg@cornell.edu djf5@cornell.edu 8 Make it a chart: o Format quick filter (single value) o pin axes (edit axis>fixed) o show empty columns (Analysis>Table Layout>Show empty columns) o Title (Undergraduate Chemistry Courses, Spring 2013) o Edit colors (Color Box>Edit Colors>use palette “Color blind – 10”) clarkberg@cornell.edu djf5@cornell.edu 9 Add Another Data Source 1. Right click on data > Edit Connection> Select Multiple Tables and then Add Table clarkberg@cornell.edu djf5@cornell.edu 10 2. Highlight “Enroll Test” and then go to Join Tab. See below join and then select OK. clarkberg@cornell.edu djf5@cornell.edu 11 3. Save as a Tableau Workbook… or save as a Tableau Packaged Workbook if you need to share with other users. Sharing: Publish to Tableau Public (free) to post on the web for all to see… and for all to download! Publish to Tableau Public Premium ($$) to post to the web but disallow downloading Send packaged workbook via e-mail to someone who has Tableau Reader (free) Publish to your Tableau server (if you have one) clarkberg@cornell.edu djf5@cornell.edu 12