Tableau is a top-rated Data Visualization tool. Tableau is a self-service BI and analytics tool, capable of building compelling visualizations. Being a BI and analytics tool, it is sometimes necessary to perform some actions on data to bring it in an accessible format. Tableau has a specific set of functions to change the data in some way. These functions are called as “Aggregate Functions” in Tableau. For example, Average, summation, etc.
Read More: What is Tableau?
Tableau Aggregate Functions
The following are the aggregate functions in Tableau:
- AVG – Average
- ATTR – Asterisk
- COLLECT – Collect
- CORR – Correlation
- COUNT – Count
- COUNTD – Discount Count
- COVAR – Covariance
- COVARP – Covariance based on Population
- MAX – Maximum
- MIN – Minimum
- MEDIAN – Median
- PERCENTILE – Percentile
- STDEV – Standard Deviation
- STDEVP – Standard Deviation based on Population
- SUM – Sum
- VAR – Variance
- VARP – Variance based on Population
Top 11 Key Tableau Features that You Must Know
1) AVG
It returns the mean value of all the expressions involved. It ignores null values.
Syntax
AVG (expression)
Example
AVG ([Sales]) = 200
2) ATTR
It returns only a single value of the whole row calculated. It ignores the null values, and if the conditions are not met will return asterisk.
Syntax
ATTR (expression)
Example
ATTR ([country]) = India
3) COLLECT
It combines the values that are in argument fields, and it is used for spatial domains. It ignores null values.
Syntax
COLLECT (expression)
Example
COLLECT ([Geometry])
4) CORR
It represents correlation and returns -1 for negative, 0 for no relation and 1 for positive changes when two variables are compared.
Syntax
CORR (expression 1, expression 2)
Example
CORR (1, 2) = -1
Read More: Tableau Date Functions
5) COUNT
It returns the number of values present in selected in a column. It ignores the null values.
Syntax
COUNT (expression)
Example
COUNT ([Sales ID]) = 5432
6) COUNTD
It returns the distinct count of the column or group. It ignores the null values.
Syntax
COUNTD (expression)
Example
COUNTD (‘Country’) = 256
7) COVAR
It represents the covariance between two expressions where the positive outcome indicates that the variable moving in the right direction.
Syntax
COVAR (expression 1, expression 2)
8) COVARP
The only difference between COVAR and COVARP that COVARP is based on population.
Syntax
COVARP (expression 1, expression 2)
9) MAX
It returns the maximum values from the expression.
Syntax
MAX (expression)
Example
MAX ([Age]) = 107
10) MEDIAN
It returns the middle value of the given expression.
Syntax
MEDIAN (expression)
Example
MEDIAN (1, 2, 3, 4, 5, 6, 7) = 4
Learn to Create Tableau Dashboards
11) MIN
It returns the minimum value of the given expression.
Syntax
MIN (expression)
Example
MIN ([Sales Rate]) = 4
12) Percentile
It returns the percentile value of the given expression between 0 and 1. If a decimal number is delivered, it will return the median value.
Syntax
Percentile (Expression, number)
Example
Percentile ([Sales], 0.54) = 37.69
13) STDEV
It returns the high or low deviation values.
Syntax
STDEV (expression)
14) STDEVP
Same as STDEV, the only difference is STDEVP is based on population.
Syntax
STDEVP (expression)
15) SUM
It returns the sum value of the given numeric values. It ignores the null values.
Syntax
SUM (expression)
Example
SUM (1, 2, 3) = 6
16) VAR
It returns the variance in a given expression.
Syntax
VAR (expression)
17) VARP
It is same as variance, but it is based on population
Syntax
VARP (expression)
Conclusion
In this article, we discussed all the aggregate functions in Tableau along with syntax and possible examples for better understanding.
Source: https://yodalearning.com/tutorials/tableau-aggregate-functions/