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 do I recreate the Number of Records?

If you still want the [Number of Records] 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

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.

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

Leave a Comment