9 Replies Latest reply on Sep 19, 2018 7:06 PM by harish kumar

    Doubt on Pie Chart

    harish kumar


      Good Evening!


      This is harish kumar, here i have doubt on Pie chart.@


      i want to see the Top 10,20 and other customers in a single pie chart based upon the Sales.


      here anyone can you help me on this scenario.

        • 1. Re: Doubt on Pie Chart
          Vincent Baumel

          I think I get what you're after, Harish. Here's how I approached it.


          Rather than creating separate groups for each subset of customers, I wrote a calculation that looked like this:



          This will group things into the 3 categories you're looking for, but it's a Table Calculation so here's the catch - whichever dimension you want to group (in our case Customer) will have to be in the visualization somewhere. This is easy enough to do in a validation table:


          Now the next step is a little hacky, but it can get you what you're after. Let's start with a sorted pie chart of sum(sales) per customer:

          Yikes, right? Now though, bring your new Rank Groupings calculation onto color. Everything turns blue, since it sees 1 thing on the table (the pie chart). What we need is to have Customers somewhere on the viz. Bring Customer Name onto detail, right click the Rank Groupings calc, and select Compute Using > Customer Name. This gets us closer, so now we just have to sort the Customer Name field. Right click and sort Descending by Sum of Sales and you get this:


          Like I said it's a little hacky, and your tooltips won't do you much good, but it's a way to visually represent what you're after. Since we can't fix an LOD to a table calc we can't do something like {FIXED [Rank Groupings]: COUNTD([Customer Name])} but this is one way to get there.



          I hope that helps! Mark this as correct if so.






          4 of 4 people found this helpful
          • 2. Re: Doubt on Pie Chart
            Michael Ye



            The simplest way is to build top 10 and top 20 set based on Customer ID, then put SUM([Sales]) to Angle, both Top 10 and top 20 set to color and label sales, you will get it.


            Hope it helps.


            Michael Ye


            8 of 8 people found this helpful
            • 3. Re: Doubt on Pie Chart
              harish kumar

              Hi Michael,


              Thanks for giving reply for my concern,


              but through Sets im not able to drag 2 sets in Colors shelf, i have created

              Through groups.


              Can you help me on how to create through Sets.


              Thanks in Advance.


              On Wed, Sep 19, 2018 at 9:39 PM Michael Ye <tableaucommunity@tableau.com>

              • 4. Re: Doubt on Pie Chart
                Vincent Baumel

                Bring your second set to detail first, then click the data type icon and switch it to color AFTER it's been put into the marks card. That might do the trick.

                • 5. Re: Doubt on Pie Chart
                  harish kumar

                  Hi Bro,


                  Thanks for giving reply for me.

                  • 6. Re: Doubt on Pie Chart
                    Michael Ye



                    Select top 10 Set, then press ctrl key and select top 20 set, thus you can select both sets.

                    Then drag them to color.


                    Michael Ye







                    6 of 6 people found this helpful
                    • 7. Re: Doubt on Pie Chart
                      harish kumar

                      Hi Michael,

                      I have done with your scenario but while dragging two sets into the colors im not able to see the values of one filed. when we are selecting average sales im able to see.Sales Error.JPG

                      1 of 1 people found this helpful
                      • 8. Re: Doubt on Pie Chart
                        Michael Ye



                        Click the label, check


                        Allow Labels to overlap other marks.


                        The labels for both set will be shown.


                        Michael Ye

                        7 of 7 people found this helpful
                        • 9. Re: Doubt on Pie Chart
                          harish kumar

                          Hi Michael,


                          Good Day!


                          By using your scenario i have done. Thanks for your great information. Finally i done it.



                          Harish Kumar N