4 Replies Latest reply on Dec 8, 2015 8:06 AM by Simon Runc

    Beginner ranking question

    Amanda Zimmerman

      Hi everyone - I'm very new to Tableau and trying to understand some basic concepts still. I'm working with a file that contains credit card transactions and includes the buyer's name, transaction date, amount, etc. I figured out how to use sets to sort the top N buyers by transaction sum. What I would like to do now is see the top N by month - so see a list of the top spenders in January, then February, and so on. Will someone point me to some advice on what to do next? I've watched some of the tutorials on sets, calculations, and parameters, but it is all a little overwhelming at first. Thanks!

        • 1. Re: Beginner ranking question
          Simon Runc

          hi Amanda,

           

          Welcome to the community!

           

          So this concept (and the example you have given) will get you along way (hopefully!) to start understand 'How Tableau Thinks', and in particular how Table Calculations work.

           

          So to do this we use the RANK function. This is a Table Calculation, which means that the results aren't 'hardcoded' into the data, but are dependent on the level of detail in your Viz, and how you set it up. I've worked up and example from superstore

           

          So first I create my Rank function on Sales

          [Rank]

          RANK(sum([Sales]),'desc')


          I've then also made it discrete, so I can display it as a column in the Table (you don't need to do this to make it work btw). When we bring this field into the Viz, Tableau will set it up in a default fashion (kind of a 'best guess'). For Table Calculations there are 2 concepts;

          Addressing and Partitioning. Addressing means, what should I run this RANK function over (in our case we want this to be Customer, as these are who we want to rank). Partitioning means, restart my rank every x.


          So I go into the 'Edit Table Calculation' (you can find this by right clicking on the measure), and goto 'advanced'. In here I've set this up as follows

          TC Set Up.PNG

          So we are saying 'Rank (Descending) the customers on SUM of Sales, and restart the Rank every month'

           

          Once we have this, we can drag the Rank to filter shelf, and select numbers 1-10...and voila

           

          Hope that helps, and makes sense, but please post back if not as there are some great blogs on the subject of Table Calculations I can point you to.

          • 2. Re: Beginner ranking question
            Tableau kumar

            Hi Amanda Zimmerman,

             

            check whether the following link helps you.

             

            Tableau BI: How to Create Ranks in Tableau

             

            Best Regards

            Tableau Kumar

            • 3. Re: Beginner ranking question
              Amanda Zimmerman

              Thank you for your help! I used your instructions to figure it out. Still working on understanding it all, but I'm starting to piece it together. I'd love to see your blog recommendations if you have them handy.

              • 4. Re: Beginner ranking question
                Simon Runc

                hi Amanda,

                 

                In terms of Table Calculations (as well as the On-Demand Videos Tableau provide) I'd also check out this great Think Data Thursday Webinar

                 

                TDT with Jonathan Drummey - July 10, 2014

                 

                I'd also check out this blog

                Want to Learn Table Calculations? Here’s How! | Drawing with Numbers

                 

                there are links that will take you to a series of Blogs/Posts going from beginner to Zen in Table Calcs