4 Replies Latest reply on Jan 25, 2012 11:03 AM by P Fro

    Line View with each line showing percent total of itself

    P Fro

      I'm trying to create a line graph along months with each line being a separate year (in this case 2010, 2011). I want to see the percent total of each line running across each year. In other words, I want 2010 to total 100% and 2011 to total 100%. I can get the result I need by creating a separate row for each year and using the "Percentage of Row in Pane" option, but I would like the two lines to be in the same row (with labels for the year). Any ideas users? I have attached an example of what I have now...what I need is that exactly but with each line on the same row.

        • 1. Re: Line View with each line showing percent total of itself
          Jonathan Drummey

          Put your Date field on Color shelf (with line charts, the only ways to get multiple lines on the same pane are to use the Color Shelf or dual axes). By default, Tableau will assume it is YEAR(Date) and assign each Year's results to a color. If you don't already, you will need to edit the table calculation to set the Compute to Month of Date so the % works.

          • 2. Re: Line View with each line showing percent total of itself
            P Fro

            Jonathan, thanks for the quick response. I understand that I need to move the date field to the color shelf in order to separate the lines, however, I'm having trouble with the second part where you say: "edit the table calculation to set the Compute to Month of Date so the % works" Are you saying that I need to crate a calculated field using the Date field? I have tried to use the "Percentage Of" in the Analysis menu but for my purposes I need something like a "Percentage of Color" option since Percentage of Table, Row, Pane, etc. don't give me the results I'm looking for...

            • 3. Re: Line View with each line showing percent total of itself
              Jonathan Drummey

              I've attached a workbook showing what I was talking about. When you do the "Percentage Of" in the Analysis menu, it changes the given measure into a table calculation, which is indicated by the little triangle on the left side of the pill. Assuming that you've got your Date pill on the Columns Shelf, Visits on Rows (set to Percentage Of), and YEAR([Date]) on the Color shelf, what you need to do is:

               

              1. Click on the pill and choose Edit Table Calculation... from the context menu. A Table Calculation dialog opens.

              2. For the Summarize the values from: dropdown, choose Advanced... The Advanced dialog opens with Year of Date and Month of Date as options.

              3. Select Month of Date and click on the > button to move Month of Date into the Compute Using section.

              4. Set the Order along to whatever you like, in this case it doesn't really matter (as far as I can tell) because there's only one pane.

              5. Click OK to close the Advanced dialog.

              6. Click OK to close the Table Calculation dialog.

               

              Let me know if this works for you!

               

              Jonathan

              • 4. Re: Line View with each line showing percent total of itself
                P Fro

                EXACTLY what I was looking for! Thank you so much for your help and for going to the trouble of creating the view for me! I had a “duh” moment as soon as I opened that edit table calculations field. I should have remembered from the training videos! Thanks again.