14 Replies Latest reply on Jun 13, 2016 4:18 AM by Mark Fraser

    Problem on Donut

    Sri K

      Hi friends,

       

      I have a requirement on coloring donut chart according to filter selection.Here as per snapshot attached, technologies is used as quick filter and I put that filter as multiple selection.

      Now, I want this donut to get 2 different color, first for aggregation of all selected in quick filter and second color for all non selected filter. The percentage(for selected part only) should be shown in between of donut as shown in picture.

       

      donut issue.png

       

      I can achieve this from parameter but it has multiple constraints like multiple selection, re usability issue,so please use only quick filter concept.

       

      For better understanding of my requirement here,I am putting a mock below:

       

      Let technologies has these members with their server count.

       

      Technology     Server count     Percentage

       

      Tableau               40                    40%

      MSTR                  20                   20%

      Qlik                     30                   30%

      BO                      10                     10%

       

      Now if user has selected MSTR and Tableau both under quick filter,donut should be colored with 60% with one color(for selected portion) and rest all selected 100-60=40% should be colored with some other color(for non selected values).

       

      Any help will be highly appreciable.

       

      Thanks,

      Narayana

        • 1. Re: Problem on Donut

          Hi Sri K,

           

          I think this article from our knoweldge base will help you on this case.

          Also, please find attached my Workbook to help you illustrate the article.

           

          Donut.jpg

          1 of 1 people found this helpful
          • 2. Re: Problem on Donut
            Mark Fraser

            Hi Sri

             

            You already have a good answer from Lenny

             

            Whether Donut Charts are 'best practice' or not is up debate... Andy Kriebel isn't a fan (for good reason)

            but he has provided steps to create Donut charts in his excellent blog post  >> Tableau Tip: How to make KPI donut charts

             

            Cheers

            Mark

            2 of 2 people found this helpful
            • 3. Re: Problem on Donut
              Sri K

              Hi Lenaic,

               

              Thanks for responding.

               

              I am able to create a donut chart, but here the issue is to get 2 different color in the donut, first for aggregation of all selected in quick filter and second color for all non selected filter.

               

              Thanks,

              Narayana

              • 4. Re: Problem on Donut
                Sri K

                Hi Mark,

                 

                Thanks for your response.

                 

                Here my issue is different.. Now, I want to show in only one donut to get 2 different color, first for aggregation of all selected in quick filter and second color for all non selected filter.

                 

                Example: 

                Let technologies has these members with their server count.

                 

                Technology     Server count     Percentage

                 

                Tableau               40                    40%

                MSTR                  20                   20%

                Qlik                     30                   30%

                BO                      10                     10%

                 

                Now if user has selected MSTR and Tableau both under quick filter,donut should be colored with 60% with one color(for selected portion) and rest all selected 100-60=40% should be colored with some other color(for non selected values).

                 

                Thanks,

                Narayana

                • 5. Re: Problem on Donut
                  Mark Fraser

                  Hi Narayana

                   

                  Is this what you wanted? (We can swap the % either for selected or non selected)

                  Add Qlik in

                   

                  The key is to calculate the 'non selected' = 1-SUM([Percentage])

                   

                  9.3.1 workbook attached.

                   

                  Cheers

                  Mark

                  3 of 3 people found this helpful
                  • 6. Re: Problem on Donut
                    Sri K

                    Mark,

                     

                    Thank you so much for your reply.

                     

                    With sample data u got it. But i am not able to get the solution.

                     

                    Here I am attaching sample data and please check it once.

                     

                    Thanks,

                    Narayana

                    • 7. Re: Problem on Donut
                      Mark Fraser

                      Hi Narayana

                       

                      The issue is the way your calculating the Server Count, which in turn affects the other calculations.

                      Try this - (assuming you have v9)

                       

                      Server Count >> {INCLUDE [Technology] : COUNT([Asset Name])}

                      New field Total Server Count >> {COUNT([Asset Name])}

                      Selected becomes >> [Server Count]/[Total Server Count]

                      Outstanding is fine.

                       

                      The chart will go Red.

                      Swap the highlighted values, for the new formulas, just drag the new Outstanding, on the old, new selected on old.

                      keep repeating across tabs, until no more red

                      and

                       

                      Should end up working

                      9.3.1 attached, its you original, but I had to upgrade it.

                       

                      Any questions please come back to me.

                       

                      Cheers

                      Mark

                      • 8. Re: Problem on Donut
                        Sri K

                        Hi Mark,

                         

                        Thank you so much for working on this.

                         

                        Whatever you have done everything seems correct. But when i have selected few fields in quick filter, % should shown correct, but colors in donut showing wrongly. please check it one.9.png10.png

                         

                        Thanks,

                        Narayana

                        • 9. Re: Problem on Donut
                          Mark Fraser

                          Sorry, my bad... Forgot one (turns out crucial!) thing!!

                           

                          Swap Outstanding to >> 1-SUM([Selected])    (we need to aggregate the selected!!)

                          Outstanding, will turn red, swap the field as before, should now be OK

                          Cheers

                          Mark

                          1 of 1 people found this helpful
                          • 10. Re: Problem on Donut
                            Sri K

                            Thank you so much for your help.. Got the solution...

                            • 11. Re: Problem on Donut
                              Sri K

                              Hi Mark,

                               

                              I Have one small doubt in calculation fields. What is the use of {count([asset name])}.. If I am trying to use without {}, i am getting errors. Can you please advise why we are using {}.

                               

                              Thanks,

                              Narayana

                              • 12. Re: Problem on Donut
                                Mark Fraser

                                Hi Narayana

                                 

                                Your original example -

                                 

                                Technology     Server count     Percentage

                                Tableau               40                    40%

                                MSTR                  20                   20%

                                Qlik                     30                   30%

                                BO                      10                     10%

                                 

                                How did you get the % above?

                                You took the server count per technology (the numerator, 40) and divided it by the total of Server Count (the denominator, 100)

                                So for Tableau it was (40/100)*100 = 40%

                                 

                                The {} are LoD expressions, they are new from Desktop v9

                                I use them in 2 places -

                                 

                                Server Count = {INCLUDE [Technology] : COUNT([Asset Name])}

                                In English, splitting the data by technology, count the servers (just like your example table)

                                This one is the numerator, 40 for Tableau

                                 

                                Total Server Count = {COUNT([Asset Name])}

                                In English, count the total number of servers from the data, ignore workbook filters.

                                This one is the denominator, always 100

                                 

                                In short, the {} control the data we get and therefore use in the calculations.

                                I'll stop there, does that make sense? I may have completely confused!

                                 

                                Cheers

                                Mark

                                • 13. Re: Problem on Donut
                                  Sri K

                                  Hi Mark,

                                   

                                  Thank you so much for giving such a good explanation. Its really helps me a lot.

                                   

                                  Thanks,

                                  Narayana

                                  • 14. Re: Problem on Donut
                                    Mark Fraser

                                    You're very welcome, what you see is attempt 6 or 7, I tried to add detail without complicating it too much

                                     

                                    LoD expressions are very powerful, really worth reading up on more!

                                    Overview: Level of Detail Expressions

                                    and

                                    Top 15 LOD Expressions | Tableau Software

                                     

                                    And they look to be extended in v10, very exciting

                                    Coming Soon

                                    (except sadly no inbuilt donut charts, yet! )

                                     

                                    All the best

                                    Mark