4 Replies Latest reply on Mar 27, 2019 1:40 PM by Yoni Kaszynski

    Tooltips in pie chart as a percentage [Tableau 2019.1]

    Yoni Kaszynski

      Hello,

       

      Thank you in advance for helping me out. This is my first "real" project for Tableau, so I am kinda learning by trial and error. I am a student. Anyways, my dataset is from the Department of Transportation Form 42 which in this case is the income statement for all airlines in the United States. I am creating a pie chart to show the expenses each airline and the magnitude of each. I have the different airlines as filters, so I think I am doing that right. Anyway, I think I am kind of using a hack for the measure values, by putting all the expense accounts in there, because I will need to make a new measure values for the revenue accounts later. Am I using measure values correctly? Also, I would like to show with the tooltip the percentage each expense is relative to the whole pie, how do I do that? I found answers online, but none that had used measure values in the same way I did. I would like to make multiple measure values, is that possible? Also, I would also like to change the colors on the pie so they are completely separate from each other instead of just different shades of blue. How would I go about doing that?

       

      Thanks again

       

      Yoni

        • 1. Re: Tooltips in pie chart as a percentage [Tableau 2019.1]
          Peter Fakan

          Hi Yoni,

           

          The short answer is no. Each Pie element is equally proportioned as 1/9 scale, not the percentage of the whole. You can see this when you hover over Deprec Amort (2.7m) whose Pie slice is exactly the same size as Flying Ops (15.8m).

           

          I've mocked up an alternative for you to take a look at - in this version I have removed the operating expenses you had indicated and have replaced it inside the pie as a single measure, which is then divided up by unique carrier which I just randomly picked out of the dimensions (most probably because it was first).

           

           

           

           

          HTH 10.5 attached

           

          Peter

          • 2. Re: Tooltips in pie chart as a percentage [Tableau 2019.1]
            Yoni Kaszynski

            Thank you for the help. How would I go about making a filter that changes lets you pick the different expense, or even just let you pick let's say "operating expense" or "operating revenue" and then see what percentage comes from each line item? For example I could pick Alaska Airlines, and then could see what percent of their expenses from each line item?

             

            Thank you

             

            Yoni

            • 3. Re: Tooltips in pie chart as a percentage [Tableau 2019.1]
              Peter Fakan

              Hi Yoni,

               

              You would need to pivot the measures into one large columular dataset - shown here (select all the variables to pivot, then r/click and select pivot, and I renamed the pivot fields and deleted all of the old columns )

               

               

              Also shown here but filtered to a single airline. From here I'd suggest either building sets or groups for your expenditure and income lines to separate them into the display groupings you are looking for - I don't know what they are so I'm limited in where I can go with this from here. With this in place you can then do table calculations to look at the % contribution etc. though.

               

               

              HTH

               

              Peter

              • 4. Re: Tooltips in pie chart as a percentage [Tableau 2019.1]
                Yoni Kaszynski

                Hello,

                 

                Thank you so much for your continued help. Pivoting was exactly what I was looking for, I just did not know how to do it. The problem with pivoting is it removes your measures from the prepivoted book. I tried to get around this by making a copy of the sheet, but I don't think this is what I want to do. How do you get pivoted data to work with your prepivoted measures. For example I want to use Operating Income as a measure not a filter in a table, how would I do that?

                 

                For example I want to use my filter income and expenditures to choose the line items to dictate the angle and tooltips for the piechart. But I want my values that I had before you pivoted to dictate the size of the pie. I want to have total expenses dictate the size of the pie, and then the line items as the slices. To show to proportion of expenses to all expenses. Now with the pivot I can filter by airline/carrier which is good. What I ultimately want to do is to be able to choose the airline, and then the pie will be sized from their total expenses, and the slices will be that carriers line item numbers. I have also attached a readme on the data so you can understand what ones are revenues and what ones are expenses.

                 

                I have attached 3 items

                1. The "pre-pivoted" book

                This contains in the data source a copy of the original excel document, and I thought if I could pivot it I could keep the measures, but it turns out, I cannot.

                2. The "post-pivoted" book

                This is pretty much what you just sent me. It just includes the pie chart I was trying to make.

                3. The readme on the data

                This explains what accounts are revenue and what is an expense. I also do not know how to address the accounting changes, because some are positive and some are negative. On Tableau I ideally would like to have a measure for each of the revenue accounts, the total operating revenue, each of the operating expenses, the total operating expense, the net accounting changes, and the net income. In addition with the pivoted table it's hard with the filters to discern what is a revenue and what is an expense, how would I go about making it easier to discern, would I redo the headers on the excel document, and make a prefix of "R" for revenue and "E" for expense to all the headings? Because when looking at the headings it's confusing what ones are revenues and expenses? Is there a way to make folders for filters?

                 

                Thanks so much again for the help.

                 

                Yoni