Advanced Calculations: Aggregating Dimensions


1. Three situations that dimension aggregations are needed

  1. When blending multiple data sources
    • When blending multiple data sources in which the dimensions don’t have a consistent level of detail, Tableau will aggregate the linked dimensions to the same level of detail
  2. In calculations
    • When dimensions are used in calculations with aggregated measures, they must be aggregated
    • Tableau can’t mix aggregate and non-aggregate comparisons in calculations
  3. When you just want to know the aggregation of a dimension

2. Three ways to aggregate dimensions

  1. Aggregated in a calculated field

  2. Aggregated by right-clicking and dragging the dimension into the view

    image-20210608162432334

  3. Aggregated after they are added to the view by using the context menu

    [dimension] field --> drop-down menu --> Attribute / [Measure]

    image-20210608162831618



3. Five types of aggregations that can be applied to dimensions

  1. Minimum [dimension]
    • returns the first alphabetic value (the top of the list)
  2. Maximum [dimension]
    • returns the last alphabetic value (the last of the list)
  3. Count [measure]
    • returns the total number of entries in the field
  4. Count (Distinct) [measure]
    • returns the total number of unique entries in the field
  5. Attribute
    • if it has a single value for all rows --> returns the value of the expression
    • otherwise --> returns an asterisk (*)