2 Replies Latest reply on Dec 16, 2013 11:38 AM by Div Bhansali

    Newbie question: Year-over-year line chart

    Div Bhansali

      Newbie question here- I'm trying to create a line chart that shows how each of the 30 teams in the NBA has changed from 2012 to 2013 in offensive efficiency. In other words, there would be 30 lines (one for each team), going from 2012 to 2013 on the x-axis. But I just can't seem to figure out how to viz that in Tableau Public. I'm attaching my data here. I tried using the Excel Tableau convertor, and then also tried in Sheets 2 and 3 to convert to pure date format for the years. Any suggestions would be appreciated.

        • 1. Re: Newbie question: Year-over-year line chart
          Jim Wahl

          You could use the data either in the original format (Sheet1) or in the reshaped format (Sheet1-Tableau).

           

          Typically reshaped, "tall" data is easier to work with in Tableau. Here you can drag the "Col2" (the date/description--it helps to rename these after using the Tableau reshape tool) column to the Columns Shelf. Drag the Ponts measure to the Rows shelf (I'd convert this to AVG(Points) by clicking on the pill in the Rows shelf > Measure > Average).

           

          Now you have a line with the AVG(Points) between the two years. To get a color per team, drag Team to the Color button. The colors work very well here, because there are too many teams. It might be better to color by a category with something more general (by whether the teams made the conference semifinals, for example).

           

          Finally, you can add label the lines by dragging Team to the Label button and selecting label lines ends, don't overlap, ...

           

          2013-12-14 20-58-18.png

           

          You've basically created a rough Slope Graph, which are very popular these days---Google Tableau Slope Graph and you'll get quite a few how-to examples, including this nice one by Ben Jones.

          Slopegraphs in Tableau | DataRemixed

           

          Jim

           

          P.S. The other approach that doesn't require reshaping is drag Measure Names to the Columns shelf, Measure Values to the Rows shelf. Remove the Number of Records pill from the Measure Values shelf. You get an identical result.

           

          See attached.

          • 2. Re: Newbie question: Year-over-year line chart
            Div Bhansali

            Thanks Jim - that's exactly what I was looking for!