Number of Records is missing in Tableau

//

Have you noticed the Number of Records field in Tableau has disappeared? If not you’re using a version of Tableau pre-2020.2.

The release of Tableau 2020.2 was the end of the [Number of Records] field. Although not a field I used regularly, the Number of Records field was useful for doing what it suggests…counting the number of records.

Where has the Tableau Number of Records field gone?

Tableau has introduced a replacement for the Number of Records field in 2020.2, with full details in this article. For each table in the data source Tableau has added a new field [TableName (Count)]. The use of italics is deliberate as the new field appears in italics in Tableau Desktop.

Image of the new count field in italics
Count of records in a table called Orders

To save you having to read the Tableau article to find the Number of Records text (it’s a long article), Tableau state the following:

You will no longer see the Number of Records field in data sources that contain logical tables. Every table includes a count of its records, as a field named TableName(Count), at the level of detail for that table. In the previous example you can see Addresses(Count), Customers(Count), and LineItems(Count).

 

COUNT of table = SUM of Number of Records per table. You can’t build calculations on top of a table’s Count field. Count is aggregate-only.

Using the new Count of records field

The new field offers similar flexibility as the decommissioned [Number of Records]. However, the only aggregation allowed is COUNT. Other aggregations will cause an error.

Although Tableau state “You can’t build calculations on top of a table’s Count field”, it’s not clear to me what is meant by that.

Upon testing the new field can be further aggregated, for example, to use in a table calculation:

[Total Records in View]: WINDOW_SUM(COUNT([Orders]))

It also works in LOD calculations, for example, to fix the number of records in the data set:

[Total Records in Data Set]: {COUNT([Orders])}

It also sums in the Grand Total of a table, as demonstrated in the below table.

Setting up an example using the Sample – EU Superstore.xls data source, the results are below. Only 1 year of 4 in the data source appears in the view, to prove the FIXED calculation works. The entire data source has 10,000 records. Also the year is split into quarters to prove the WINDOW_SUM is working.

Table showing the Tableau Count field can aggregate further
The calculated fields above are all included in the table alongside the Tableau Count of Orders field

How to count the Number of Records in Tableau

If you still want the [Number of Records] field, it is very simple to recreate. The formula is 1. Yes, that’s it: 1.

[Number of Records]: 1

tableau calculated field with the formula 1 to create the Number of Records field
This formula recreates the Number of Records

Sum the recreated [Number of Records] field to count the number of records in the Tableau data source.

The disappearance of [Number of Records] may cause some questions, so now you have the answer. Replacing the vanished Number of Records is very simple.

15 thoughts on “Number of Records is missing in Tableau”

  1. Where do you enter the formula? I’m new to Tableau and have enrolled myself in a Tableau visualization specialization on coursera. How do I recreate it?

    Reply
  2. Wow, that saved me from having to do a hasty server update. Why the heck does just putting a 1 in the calculated field give you the record count for the dataset?

    Thanks for the tip, now I can do a proper server update without rushing it.

    Reply
    • It’ll just add a field with a 1 on each row, regardless of the value. Then when you sum those, you get a row count because each row is adding its 1.

      Reply
  3. I am not able to use number of records =1. When I am pulling it on label, it is giving me the result =1

    Reply
      • Hi Andrew thanks for the blog post. I am potentially having the same issue as Neha – I have the formula as 1 but it won’t aggregate so when I pull it in to my view it is always 1 and shows a different result to the table(Count). Any help would be much appreciated. Thanks

        Reply
        • Hi Will, just to confirm, you’re replacement num of records field is an integer data type? There are no “” or other characters? If it is an integer, are you sure it is SUMming?

          Reply
    • Creating a calculated field with the value 1 is the solution to recreating the number of records field in Tableau. Can you be more specific about what’s not working? i.e. error message, etc

      Reply

Leave a Comment