3 Replies Latest reply on Jul 17, 2018 6:01 AM by Vidya Sagar Malla

    Grouping the Dimensions using the measures

    Vidya Sagar Malla

      Hi,

       

      I have a very simple requirement. But I am struggling to get along with it. Please help me in sharing the idea or logic.

       

      Here is the brief information with the sample Phones data.

       


        And here is what I want to achieve in Tableau.

      • Rank has to be generated based upon the Product Subcategory and Product Name for each Product Category
      • Rank Parameters: Now I have two Rank parameters
        1. TopN: Contains drop-down values of 1,2,3,4,5,6
        2. NextN: Contains drop-down values of 1,2,3,4,5,6
      • TopCategroy: Now what I want to achieve is when I select 2 from TopN parameter Topcategorycalculated column should give me the string output  as Top 2 Products with SUM of the price for the first 2 products and when I select 4 from the NextN parameter Topcategorycalculated column should give me the string output as Next 2 to 4 Products with SUM of the Price for 3rd and 4th products.
      • Ultimately I want to show them in a PIE chat just like the below image.

       

                                                                                                                                                      

      Product   CategoryProduct   SubcategoryProduct NamePrice
      SmartPhonesAppleApple S10$         100
      SmartPhonesSamsungSamsung s7 Edge$         200
      SmartPhonesNokiaNokia 5120$         300
      SmartPhonesNokiaNokia 9$         400
      SmartPhonesSonySony Xperia$         500
      SmartPhonesMotorollaMoto Rock$         600
      LaptopsAcerAcer Aspire R$         700
      LaptopsAcerAcer Alpha$         800
      LaptopsHPHP Specter$         900
      LaptopsHPHP ENVY$      1,000
      LaptopsDellDell Inspiron$      1,100
      LaptopsLenovoLenovo Flex$      1,200

      I worked with many BI tools like Tibco Spotfire, Qlik, Microsoft Power BI. I have achieved the same result in no time. Since I am into this tool form last 2 days, unfortunately, I could not crack it.

       

      Your help will be much appreciated.

        • 1. Re: Grouping the Dimensions using the measures
          Santiago Sanchez

          Hi Vidya,

           

          In Tableau we can rank members using RANK or INDEX. These are dynamic functions calculated based on what's on displayed on the visualization. It's part of a set of functions called 'Table Calculations'. Because of this, you need to have all 3 dimensions in the visualization and then make sure the calculation uses those 3 to run (compute using) the ranking. In other words (or images):

           

          Step 1:

          Step 2:

           

           

          Step 3:

           

          Index is a calculation that uses the parameters for [Top N] selected by the user:

          That does it. I personally think that a pie chart is not the best way to display information, but given there's only 3 pieces in this pie, it may be OK. If you were to have more than that, I'd encourage you to explore a bar chart instead:

           

          With Tableau Prep now part of the Tableau Platform, you could now create the rankings as part of your data set, which would eliminate the need to use Table Calculations. An example regarding how you calculate a rank in Prep can be seen here: Rank and Ranking in Tableau Prep | VizPainter

           

          If you'd like to learn more about Table Calculations and other functions in Tableau, I'd suggest looking at the free training videos available here: Tableau Training: View Training Courses

           

          Hope this helps!

          Santiago

          • 2. Re: Grouping the Dimensions using the measures
            Vidya Sagar Malla

            Hi, Thanks for Looking into this. But I am seeing the wrong values when I marked the labels for SUM of Price on the PIE.

             

            However I was able to fix the issue in very complex route I believe. Soon I post a video to this link. Just to let you know I am just ~4 days old with Tableau.

             

            Once again I really appreciate your help!!

             

             

            When I applied the custom sort for the sum of price in desc. I am getting PIE like this.

             

            • 3. Re: Grouping the Dimensions using the measures
              Vidya Sagar Malla

              Here is the video link:

              1 of 1 people found this helpful