3 Replies Latest reply on Nov 6, 2017 12:59 PM by Paul Sutherland

    Measure - Number of Records

    Bas Groothedde


      I wonder what the automatically generated measure 'Number of Records' means and what it is used for (please list some examples).

      There is not even a real computation done...


      Looking forward to your reply!

        • 1. Re: Measure - Number of Records
          Ashish Chaudhari

          Hi Bas,


          Regarding Number of Record (automatically generated column) is an calculated field which contains value as 1. So it is associated with each of your records. Once you put it in the Rows or columns you will get the number of records in the database.. I basically use the number of records to check the if my data joins are proper or not.

          Eg. If you have table A which contains 100 rows and want to join it with the table B. (Joining means adding additional columns to the data.) So after the join if the number of rows are greater than 100 then I need to check my join again. If there is drastically difference after joining the data then using "Number of Records" columns you can identify if the join is wrong.


          Another eg.

          Suppose you have a social data where you want to get the number post on facebook. Rather than taking count of any of the dimension you can use the "Number of Record".


          Let me know if you have any queries.



          Ashish Chaudhari.

          4 of 4 people found this helpful
          • 2. Re: Measure - Number of Records
            Simon Runc

            hi Bas,


            So the [number of records] is simply that! and if you look in the field (you'll notice it's a calculated field) and it just contains the number 1. So the SUM of this field is the number of records (rows of data) in the view. This is essentially the 'grain' of the data (what does one row of data represent, so for superstore sales one row represents an Order/Product). The 'grain' of the data (or if in a Viz the Viz Level of Detail, aka VizLoD) is a very important concept in Tableau...here are a couple of blog posts with a bit more detail




            The Importance of Granularity (…to Blend or not to Blend?) | The Data Animators


            Hope that helps.

            3 of 3 people found this helpful
            • 3. Re: Measure - Number of Records
              Paul Sutherland

              One way that I am using the Number of Records field is to calculate a homegrown AVG.


              There is a field "Sold" with values 'Y' or 'N' and 'Pending' and I want to calculate the average items that have been sold. I am using the following Calculated Measure:


              SUM(IF([Sold]="Y") THEN 1 ELSE 0 END) / SUM([Number of Records])