How to use Count and Count Distinct functions properly in Tableau

  • Tableau FAQs
  • December 11, 2018
Get Started Transforming Your Data in Snowflake

In this post, we discuss how to use the Count and Count Distinct functions properly in Tableau.
These functions can be used either alone or in conjunction with other functions. These are basic functions that are easy to use and quite useful.

COUNT() –  This function returns the number of NON-UNIQUE rows in the selected dimensions, or it can just be the number of rows in any other dimensions. So, for example, we need to count the number of NON-UNIQUE EmailPromotions (as shown in the image), then we will use the following expression:

COUNT ([EmailPromotion])  – The result of this expression will be the sum of all rows in the selected field.

COUNT Function
COUNTD()  – This function will always return the number of UNIQUE values in the selected field. This means that if you have a field with two values 0 and 1 in a table with 100 rows, this function will return the value 2, unlike COUNT () where the result would be 100.

COUNTD([EmailPromotion]) – The result of this expression will sum unique rows in the selected field.

COUNTD Function

That is how to use the COUNT and COUNTD (Count Distinct) functions properly in Tableau.

A SIMPLER ALTERNATIVE IN DATAMEER FOR HOW TO USE THE COUNT AND COUNT DISTINCT FUNCTIONS

There is a more accessible alternative to memorizing all the useful queries you employ every day and their syntax.

Insert the COUNT and COUNT DISTINCT functions into your queries with just the click of a button, no code is needed!

Watch the video below to learn how count and count distinct functions work in Datameer.

Datameer’s intuitive self-service and simple Excel-like interface provides you with robust catalog-like data documentation, data profiling, and a rich array of functions available through a graphical formula builder.

This allows your data engineering team to perform faster data preparations for business intelligence, analytics, and visualization.

Think of how much time you can save from querying your datasets.

Don’t just think about it; click to experience it for Free with a 14-day trial


Up Next:

Read How do I locate the source data files used in the Tableau Global Superstore Sales example?

Related Posts

Data Blending Limitations in Tableau

  • Benoite Yver
  • January 11, 2020
Lots of falling red and white dice with question marks on the si

Strengths and Weaknesses of Tableau Desktop

  • Datameer, Inc.
  • July 12, 2020