Get the Most Out of Your Data with Tableau’s Mighty Aggregate Functions
In Tableau, aggregate functions are used to perform calculations on a set of values and return a single result. Here are some common aggregate functions that are used in Tableau:
- SUM: This function returns the sum of all values in a field.
- AVG: This function returns the average of all values in a field.
- MIN: Returns the minimum value in a field.
- MAX: Returns the maximum value in a field.
- MEDIAN: Returns the median value in a field (the value that is in the middle of the set of values when they are sorted).
- COUNT: This function returns the number of values in a field.
- COUNTD: Returns the number of distinct values in a field.
- STDEV: The standard deviation of all values in a field is returned.
- VAR: Returns the variance of all values in a field.
- FIRST: Returns the first value in a field.
- LAST: Returns the last value in a field.
- RANK: The rank of a value in a field is returned (for example, the third highest value would have a rank of 3).
- PERCENTILE: Returns the value at a specified percentile in a field.
- PERCENTILE_INC: Returns the value at a specified percentile in a field, using the inclusive method for calculating percentiles.
- PERCENTILE_EXC: Returns the value at a specified percentile in a field, using the exclusive method for calculating percentiles.
- VARIANCE(expression): Returns the variance of a field or expression.
- STDEVP(expression): Returns the standard deviation of a field or expression, using the population method.
Aggregate functions can be used in calculated fields or as part of the calculation for a chart or visualization. They can also be used with other functions, such as window functions, to perform more advanced calculations on data.