3 Replies Latest reply on Sep 14, 2016 2:34 PM by Matt Hong

    pie chart -- let user choose what goes into "others"

    Nick Zhao

      Hi everyone,


      In the attached workbook, I am building a pie chart using sample superstore dataset.


      I am drawing a pie chart based on subcategory and sum([profit]).


      What I would like to achieve is to have a filter (or filter-like control) that allows multiple value, and the pie chart would display the selected subcategories and automatically groups other subcategories into "others".


      For example, if the user selects "Copiers" and "Accessories", then the pie chart will have three pieces: Copiers, Accessories, Others. Here the size of Others should reflect the sum of all other subcategories.


      I think the challenge here is to allow users to select the subcategories. Otherwise, this could easily be done by using groups.





        • 1. Re: pie chart -- let user choose what goes into "others"
          Matt Hong

          This is currently not the easiest thing to implement. However, I can still help you with a workaround.


          You would need to create a boolean parameter for each sub-category (e.g. 'Exclude copiers'). Then, create a calculated field called 'Others or members' or something like that, which puts a sub-category in 'Others' if the boolean parameter for that sub-category is True:


              ([Exclude furnishings] and [Sub-Category] == 'Furnishings')

              or ([Exclude envelopes] and [Sub-Category] == 'Envelopes')

              or ([Exclude papers] and [Sub-Category] == 'Paper')

              or ([Exclude copiers] and [Sub-Category] == 'Copiers')

               // ... and so on


          then 'Others'

          else [Sub-Category] end


          Each sub-category and the associated parameter that the user can put in 'Others' will extend the IF condition. You now just need to put the pill for 'Others or members' on the marks card for color and show the parameter controls for each boolean parameter.


          I am including a v.10 workbook package.

          • 2. Re: pie chart -- let user choose what goes into "others"
            Nick Zhao

            Hi Matt,


            If the list of subcategories gets very long, it will generate a very long list of parameter controls, won't it?

            • 3. Re: pie chart -- let user choose what goes into "others"
              Matt Hong

              Yep, that is why I mentioned it won't be easy.


              I don't think this is a worthwhile pursuit at all. It seems weird that the user would ever be the sole arbiter of what counts as 'Others' and what doesn't.


              Some suggestions:

                   Create groups of sub-categories and give the user the ability to toggle between showing subcategories and showing groups of subcategories.

                   Order the pie slices by Number of Records, and give the user the ability to set the bottom N members to be 'Others'.