T A B L E A U T U T O R I A L - Open Library Publishing .

Transcription

BIOT 6610Hetal PatelLauren JagusTyler BoulangerElizabeth OurumisTABLEAU TUTORIAL5 th February 2019

Table of ContentsTable of Contents2INTRODUCTION3FORMATTING AND UPLOADING DATA4CREATING DATA VISUALIZATIONS8CREATING A MAP OF CANADIAN HEALTH EXPENDITURE BY PROVINCE IN 20168CREATING A LINE GRAPH OF CANADIAN HEALTH EXPENDITURE BY PROVINCE IN1975-201817VISUALIZING THE PROPORTIONAL DISTRIBUTION OF HEALTH CARE EXPENDITUREAMONG AGE GROUPS IN CANADA20CREATING A STORY WITH TABLEAU PUBLIC26SAVING AND PUBLISHING YOUR TABLEAU PUBLIC WORKBOOK31CREATING A DASHBOARD WITH TABLEAU33

INTRODUCTIONTableau is a user-friendly platform for visualizing, analysing, and sharing data. Its aim is to makeeasy-to-understand solutions based on raw data.The platform can be easily used by individual analysts or scaled across a large organization.Tableau makes it simple for data from different individuals or departments to be combined orshared in one place.There are multiple paid products produced by Tableau, each with unique services and customersegments:Tableau Prep allows users to combine, shape, and clean their data from a variety of sources.Tableau Desktop is the main platform for visualizing and analysing data and turning them intointeractive dashboards and reports.Tableau Online allows you to publish your work online and share it with anyone you give accessto.Tableau Server gives you more control over who can see your work, and it is usually used toshare data within an organization.Tableau Public is a free service that allows you to create data visualizations from limited sourcesthat must be published to the public server.Tableau’s paid products enable users to collect data from a variety of sources, includingMicrosoft Excel spreadsheets, PDF files, and web-based data providers. Your work can even beupdated live as your source data is updated. Tableau is also able to combine your data frommultiple sources into one document.Tableau can be used on desktop, tablet, or mobile, making it very convenient for sharing datawith many users on a variety of platforms. Dashboards and other work can be shared withanyone you’d like to give access to it, whether by sharing links to your Tableau profile throughsocial media or emails, or by embedding Tableau dashboards into your own website.If you are interested in learning more about using Tableau beyond this introduction, there arehundreds of eLearning and live training opportunities available on the Tableau website. A varietyof tableau certifications can also be identified through the website. More video tutorials can befound on YouTube, Lynda, or Udemy.For an example of the power of Tableau in action, check out Western Carolina University’s profileon Tableau Public to see some of their interactive dashboards at this institutional.planning.and.effectiveness#!/

FORMATTING AND UPLOADING DATAIt is important to ensure that data that is obtained from external sources is of good quality. If youchoose to select data from online sources, choose websites that are reputable. Sites such asStatistics Canada or the World Health Organization are great resources. In the examplethroughout this tutorial we selected data from The Canadian Institute for Health Information.You are able to select from various file types when working with tableau.Examples of acceptable data files include Excel files, PDF, or text files. Data can also be uploadedfrom servers such as Google Sheets.The data needs to be in the correct format before uploading to TableauThe data you want to use in Tableau should follow these guidelines.1. The data should be granular as possible. This means that your data is detailed rather than justaverage values.2. Ensure that there are no aggregated data (no total values)3. All extra titles and notes should be removed. This excludes data headers.4. Ensure that there are no blank cells or rows5. The data should follow database format where it is row-oriented rather than column oriented.Tableau is optimized to work with row-oriented tables. This can be done either in Tableau orbefore you upload your data.Here’s an example of how to reformat the dataOriginal Data

In order to optimize the data for tableau, the null data cells needs to be replaced with zeros. Theextra notes at the top must also be deleted.Once all the data is in the correct format, you can upload the file to Tableau. From the homescreen, click on the corresponding file format in the blue payne highlighted in the orange box.Select the data file you need.

Once the data has loaded your screen will look like this.From here, you can reformat the table so that it is row-oriented. While holding the shift key, selectthe data that you want to be grouped together. In this example we want three columns, the year,province, and the expenditure. To achieve this, we need to group together all the provincecolumns. After highlighting all columns we want to be grouped, click on the dropdown menu thatappears in the heading of any province columns, and select pivot table. After pivoting the tableyou can rename your columns and being to work with your data set.

Tableau will allow you to select which sheet from the file you want to work with if you have morethen one sheet in your excel file. To select a sheet, click and drag the file into the open space onthe top half of the screen. During this stage you also have the option to clean up your data bychecking the box on the left hand side of the screen.To combine a data set from two seperate sheets, click and drag the two sheets you want to thecenter space on the top half of the screen.ex) Combined data sets from different sheets on one excel fileTo begin manipulating and working with the data, select a sheet at the bottom left of the screen.

CREATING DATA VISUALIZATIONSI.CREATING A MAP OF CANADIAN HEALTH EXPENDITURE BY PROVINCE IN 2016Once you have uploaded your properly formatted geographic data your screen will looklike this:This is your Data Source page, where you can organize your data. On the left panel, youcan see the sheets that were in the Excel file that was uploaded. If these sheets havecommon fields, you can join them by dragging them to the center together. For ourpurposes, we just need Dataset 1 - Total Expenditure, so drag that sheet to the centre.But before doing this, check off the box Use Data Interpreter so that Tableau can cleanup the workbook and make it suitable for use.After cleaning the data and dragging the sheet to the centre, your screen should looklike this:

Your data is now connected, and Tableau has assigned a Data type to each column.Click the symbols in the header of each column to make sure it’s the type you want. Inour case, we want to make sure the Province column is assigned a geographic role.When we click this icon, we see that Tableau recognized the Province codes and did itfor us!We can also see that Expenditure and Year have been assigned as Numbers which isalso what we want. It's important to know about this feature for future uses.Now, on the bottom of your screen, you should see a tab labelled Sheet 1, click this.Your screen should now look like this:So now you’re in your worksheet and this is where you will build your map. On the leftside of your screen is the Data pane. The columns of your data are listed as fields andassigned as Measures or Dimensions. Dimensions are usually qualitative data andMeasures are quantitative, you can drag and drop fields in to either of these categoriesto change their assignment if needed. You can see that Tableau automaticallygenerated Latitude and Longitude Measures because we’re using geographic data.

Now, to begin creating the map, drag and drop Province into the centre of your sheet.Your screen should now look like this:You will see that longitude and latitude have automatically been placed into the Columnsand Rows shelves. You now have a basic map view that can be edited as you like bydragging and dropping other fields into the marks.We are now going to drag Expenditure into Label:

Now, each province has the sum of their health expenditures since 1975 labelled on themap. But, we only want the expenditure for the year 2016, so we have to place a filter onthe map. To do this, we will drag Year from Dimensions into the Filters box. This boxshould appear.Change the Range of values from 1975-2018 to 2016-2016 to just get expenditure datafrom the year 2016.The expenditure labels should now change to look like the above image.Now, we want to edit the label properties because we know expenditure is in millions ofdollars. To do this, we click Expenditure in the Measures tab and the drop down menushould appear. Click on Default Properties and Number format.

(1)(2)This allows us to change the properties of how Expenditures appear on our map. In thebox that appears, (2), change the Suffix to “M”, so all the expenditure values will carry anM as in millions at the end. We won’t use the Display Units option because our units fromour data are displayed in millions and it will not translate to the right amount with this setof data. In other cases, you can use this option. Also, set the Decimal places to 1. Yourscreen should now look like this:Next, we are going to colour our map based on the provinces. To do this, drag and dropProvince from Dimensions to Colour in the Marks card. Make sure to change the markstab to Map at this point from Automatic in the drop down menu. Each province is now

coloured by region (see Image 1 below). You could also colour the map based onExpenditure if you chose to drag Expenditure to colour (see Image 2 below).(1)(2)You can also click on Colours in the Marks card to edit and choose other colourschemes. Just click on Edit Colours after clicking on Colours, then click the drop-downmenu underneath Palette, and choose the one you like.Next, we’re going to create custom territories in our map. This may be useful to look attrends in certain geographic areas on the map. To do this, click on Province inDimension. From the drop-down menu, choose Create, then Group (Image 1). In the box

that opens (Image 2), you can group provinces together based on custom sub-groups.1)2)3)We are going to group ours based on regions in Canada. I am first going to select usingthe command key NL, NS, NT, PE to create a sub-group for Atlantic Canada (Image 2),click Group, then name it Atlantic Region (Image 3). I can repeat this for all regions inCanada. Click OK when finished to create all the groups and return to the main page.Now returning to the main page, I should see under Dimension a field called Province(group). If I drag this new field to the Marks section, it can be applied in a variety of waysto the map. But, I want to apply it in a way to create a map that groups expendituresbased on these regions. So, I need to create a hierarchy of my geographic region fields.To do this, I will click on Province in Dimensions and select Hierarchy from thedrop-down menu and then create Hierarchy (Image 1). From the Hierarchy dialogue boxthat appears, name the Hierarchy something, such as Mapping details (Image 2), thenclick OK. Province will now appear under Mapping details in Dimensions. Drag ProvinceGroup under this Hierarchy as well. Dimensions should now look something like Image 3.1)2)3)Having this Hierarchy made will now allow us to visualize expenditures based on thegeographic regions we created.

To do this, I will drag Province (group) to Colour in the Marks box. You will see the mapwill change and be coloured by the geographic regions (Image 1). Then, I will removeProvince from the Marks box, and the expenditures for each province will sum to theregion (Image 2):1)2)Now I want to compare between expenditures by region and province, so I want tocreate a dual axis map. So, I will drag Longitude or Latitude to the Columns or Rowsshelf, respectively, depending on what axis I want my second map to appear (Longitude Columns for besides one another, Latitude Rows for on top of one another). For thisexample, I want the maps beside one another like so:Now to change the map on the left to display expenditure by province, I will click onLongitude Generated tab to open up a Marks for just the left province. Here, I will dragProvince from Dimensions to Colour. The map on the left should change to showexpenditure by province, while the right map remains the same. Your screen should looklike this:

Congrats! You now have a Dual Axis Map to compare between provinces and regionsthe healthcare expenditures of each.II. CREATING A LINE GRAPH OF CANADIAN HEALTH EXPENDITURE BYPROVINCE IN 1975-2018Next, we are going to create a line graph of each province’s health expenditure from1975-2018. We are going to continue to use the same data as in the previous example, sowe do not have to return to the data source tab. Click on “New Worksheet” located at thebottom right of your screen next to Sheet 1 to add a new sheet. Your screen should nowlook like this:

To begin building your line graph, double click on “Expenditures” in the Measures field.Your screen should now look like this:You will see that Tableau has summed the health expenditures from the years 1975 to2018 and has placed this value in the Row shelves.We are now going to double click on “Year” in the Dimensions field.This line graph is showing the summed health expenditures across all provinces on thex-axis and year on the y-axis. We can continue to edit this graph to compare health

expenditure by each individual province. To do this, double click on “Province” in theDimensions field.You will see that the summed health expenditure for all of Canada is still be representedon the map, which is denoted by the orange line. We can edit this by dragging“Provinces“ from the Dimensions field into the Filters box. This box should appear:De-select “Canada” and then press “OK”. Your graph should now look like this:

You can change the colour schemes of the line graph similar to how we changed thecolour on the map in the previous example. Just click on “Color” and then “Edit Colors”and select the palette of your choice from the drop-down menu.VISUALIZING THE PROPORTIONAL DISTRIBUTION OF HEALTH CARE EXPENDITUREAMONG AGE GROUPS IN CANADAThis section uses a new set of data. To create a new Tableau Public workbook with thenew data, click the “New” button under the “File” tab.Using the same data uploading method as earlier, select “Dataset 2 – Expenditure byAge” from the sample data and open a new sheet.

There are several methods of visualizing the proportional distribution of data in TableauPublic. On the first sheet, you will be creating a stacked bar graph comparing health careexpenditures between provinces while also visualizing the distribution amongst agegroups. On the second sheet, you will create a pie chart that visualizes the distribution ofCanada’s total expenditure among age groups.On the first sheet, start off by double-clicking on the dimension “Age Group.” A chartshould appear showing the age groups.Next, drag the “Expenditure” measure onto the undefined data column (Containing“Abc”) on the chart. The chart then lists the total Canadian expenditure for each agegroup.Click on the “Show Me” tab at the top right of the page to display a variety of datavisualization techniques. If you already see the bar open, do not click on it. Then, selectthe “stacked bars” option to transform your data chart into a stacked bar graph.

Now, divide the expenditure data into its provincial distributions. Do this by dragging the“Province” dimension into the “Columns” bar near the top of the page.Now to add some colour to the graph to visualize the proportions better. Drag the blue“Age Group” mark to the “Color” square.

You may notice that half of each bar is one colour. This is because the “Total” value foreach province is still being included. To remove this measure, drag the “Age Group”dimension to “Filters” and de-select “Total” in the “General” tab. If you wish to alsoremove the large bar that represents Canada’s total expenditure from the graph, repeatthis step with the “Province” dimension and de-select “Canada” from the list.Your stacked bar graph is now complete! If you wish to make the graph larger or smaller,press shift command B or command B, respectively. Or you can go to the “Cell size”option in the “Format” tab.

Open a new sheet again to get started on your pie chart. To begin, double-click “AgeGroup” and drag in “Expenditure” the same way you did to start your stacked bar graph.You should again end up with a chart displaying age groups in the left column and theirrespective expenditures in the right column. This time select the “pie charts” option fromthe “Show Me” menu.Just as you did so when making the stacked bars, add filters to remove data from the“Total” age group. You should now have a pie chart with a slice & colour representingeach age group.When hovering over each slice, the respective age group and expenditure value shouldbe displayed. Another helpful piece of information is the percent of the total expenditure

allocated to that age group. To add this info, click the arrow on the right of one of thegreen “SUM(Expenditure)” buttons in the “Marks” box. Then hover to “Quick TableCalculation” and select “Percent of Total.” This both ensures that the slices of the pie areproportionate to their respective percent of total expenditure, and will also display thisinformation when you click on a slice of the pie chart.To add labels to the pie chart, drag the information that you want labelled onto the“Label” box. For example, you can label the slices according to age group.Your pie chart should now be complete! Again, if you wish to make the chart larger orsmaller, press shift command B or command B, respectively. Or you can go to the “Cellsize” option in the “Format” tab.

Congrats! You can now visualize the proportional distribution of your own data! You’realso ready to add that data to an interactive dashboard!CREATING A STORY WITH TABLEAU PUBLICWith Tableau public, you are able to organize your data in order to tell a meaningfulstory. This is beneficial when you are doing a presentation, creating an article, oruploading to a website, as it helps your audience understand your data.Stories are created through assembling the different worksheets and dashboards. Wecan highlight important data points, add text box and pictures to help convey our story.However, there are many different ways to tell a story. For example, one technique iscalled “tailoring in” where the story starts with a big picture view and zooms in on aspecific detail. In contrast, a story can also be told by starting with a case and zoomingout to that big picture view.We are going to return to our health expenditure worksheets to create a tailoring in storyand illustrate the changes in Canada’s spending in a meaningful way.To begin, select “New Story” at the bottom right of your screen.

Drag “Sheet 1” and “Sheet 2” on to “Drag a sheet here”. We can rename each storyboardby clicking “Add a caption”. Rename Sheet 1 to “Provincial Health Expenditure in 2016”.Use the arrows located on the side of the caption field to navigate to Sheet 2. Click on“Add a caption” and rename Sheet 2 to “Provincial Health Expenditure from 1975-2018”.

In this story, we are going to narrow in and draw attention to the province or territory thatis spending the most amount of money on health. Drag an additional copy of “Sheet 1”and drop it between the two existing sheets. Select “Add a caption” and rename it to“Ontario”.

On the map, click on the province Ontario and then navigate to the caption field andselect “Update”. Your screen will show Ontario highlighted from the rest of Canada.Select the right arrow to navigate to “Provincial Health Expenditure from 1975-2018”.Hover over the line representing Ontario and select the data point representing healthexpenditure during the year 2016. Then click “Update”. Your screen should look like this:

We can add a textbox to label the highlighted pointed by dragging “Drag to add text” onto the line graph. Write a key message in the textbox, such as “Ontario had the highesthealth expenditure in Canada in 2016, spending 87,195.70M”. Select “OK”.You can the edit the text box by selecting “More options” which will open a drop-downmenu. Expand the text box by dragging the borders in order to show the full message.We have now created a story with three sheets of how Ontario had the highest healthexpenditure in the year 2016. If you choose to add a dashboard, it will allow youraudience to play with data. You can navigate between the story as shown below:

SAVING AND PUBLISHING YOUR TABLEAU PUBLIC WORKBOOKOnce satisfied with your workbook, which includes sheets, dashboards, and stories, youcan publish it to the Tableau Public website. This is the only way to save your work whenusing Tableau Public, so make sure to do it if you wish to return to the workbook in thefuture.Once ready to publish, select the “Save to Tableau Public As ” option under the “File”tab.From here, you will likely be prompted to log in to the Tableau Public website. You can createan account for free if you have not already. If you are not prompted, you are already logged inand can ignore this step.

Then, create a title for your workbook.Your workbook will then be uploaded to the Tableau Public server. This may take a coupleminutes.You will then be directed to the webpage on which your workbook is publicly available fordownload. Your workbook has now been published and saved! This page includes informationon you, including a link to your Tableau Public profile, as well as additional information on theworkbook. There are several options for making use of your work data visualizations that canbe found at the bottom right of the workbook image.By clicking Share (A), you can get the code for embedding the workbook into a website or thelink to find the workbook on tableau public. The Share button also gives you the option to shareyour work over email, Facebook, or Twitter. By clicking Download (B), you or any other TableauPublic users can download your workbook and make use of the data themselves.

On Tableau Public, all saved data visualizations are uploaded and available to all other users.This means you can use other users’ work for your website, presentations, or research as well.To search for interesting data, there is a search function (D) at the top right corner of thewebpage, along with highlighted visualizations (A), authors (B), and blogs (C).When you wish to access your published workbook, or any public workbooks you’vedownloaded, in the future, simply open the Tableau Public application and your workbooks willbe there waiting for you!CREATING A DASHBOARD WITH TABLEAUDashboards are a great way to combine your data visualizations and have them interactwith one another. A lot of businesses use dashboards to keep up-to-date in real timeabout key performance indicators at a glance. In this example, we will combine just twoof our data visualizations, the map and the line graph from the first section of the tutorial,but in reality, it can be used to combine many visualizations at once.

The first step in creating your dashboard is to open up the Dashboard tab at the bottomof the screen:After clicking this icon, your screen should open to this:This is your Dashboard Sheet. On the left side you can see that there is a list of thesheets you have made from your current data source.To build your dashboard, drag the sheet you want in to the centre where it says Dropsheets here. For our purposes, we will need to drag Sheet 1 and Sheet 2 where the mapand line graph are saved. When you drag, you will notice an area of your screen willshade over where your graph will drop when you put it down. Organize your dashboardto look like the following:

Now to add titles to the graphs that were chosen, double click on the automatic titlesgenerated based on the sheet name, and a new window should appear, type in a titlethat describes the graph like so:

We can also add additional titles and objects to the dashboard by choosing an objectfrom the Objects side panel and dragging it to the dashboard. We are going to add titlesto the bottom line graph to differentiate between the Canada line and the provinces. Todo this, dragto the area near the orange line that corresponds to the sumof all provinces expenditure throughout the years. Type in “Canada”. Draglook like this:once more to label the remaining provinces. Your bottom graph shouldNow, to add an interactive layer between the graphs, we can choose a graph that can actas a filter to the other. We will choose the line graph to act as a filter to the map. To dothis, click on the line graph and a grey sidebar should appear. From this bar, click thefilter icon to use this graph as a filter:

Now, when you click a given line, it will be highlighted on the above map:Congrats, now you have an interactive dashboard that is ready to be published or saved!

CREATING A LINE GRAPH OF CANADIAN HEALTH EXPENDITURE BY PROVINCE IN 1975-2018 17 VISUALIZING THE PROPORTIONAL DISTRIBUTION OF HEALTH CARE EXPENDITURE . To begin manipulating and working with the data, select a she