4 Replies Latest reply on Aug 14, 2012 8:22 AM by Jonathan Drummey

    concept of group in tableau

    ayush tandon

      I am having a list of 30 items numbered as 1 to 30. Now i want to confine top 10 items into a field names TOP10. Please give a solution.

        • 1. Re: concept of group in tableau
          Tracy Rodgers

          Hi Ayush,

           

          If the 1-30 are in order of top to bottom then a calculated field similar to the following can be created:

           

          if [items numbered]<=10 then 'Top 10' end

           

          Hope this helps!

           

          -Tracy

          • 2. Re: concept of group in tableau
            ayush tandon

            Hey

            Thanks for the reply. I want to clear that the items numbered are jumbled up i.e they are not in ascending order..And same product items are there in different regions. So i want to give a filter giving two options.One is "top 10" and other is "all".When i click top10 radio button and a region is selected , then it should give top10 items numbered from 1 to 10 in main table in that region . And when i click all regions and top10 then it should display top 10 products globally.So how can i create a calculated field for "top10" items. Please reply.

            Thanks

            • 3. Re: concept of group in tableau
              Agustin Diaz

              Hi Ayush,

               

              One posible solution will be run a parallel query over your data that give you the TOP10.

               

              Something similar to:

               

              select Item, sum($ or other interesting field) as XXX

              from table

              group by Item

              order by XXX desc

              limit 10

               

              With this you will have always controlled TOP10 items.

              You can link this TOP10 items datasource with you main datasource and create a new variable like:

               

              If something on XXX then TOP10 else OTHER end

               

              I hope it was usefull for you

               

              Agustín

              • 4. Re: concept of group in tableau
                Jonathan Drummey

                Hello Ayush,

                 

                Posting some sample or mocked-up data would be useful in situations like this, I attempted to duplicate your requested using the Superstore Sales data. The view makes use of two parameters (one for choosing Top 10/All and another for choosing the Region) and two calculated fields to perform the filtering for region and top 10.

                 

                Jonathan