Changing Field Aggregation

You may find it useful to change the basic fields defaults in your dataset. For example, the default aggregation function for numerical values is Sum; for some measures, another aggregation operation, such as Average, is more appropriate.

The aggregation functions depend on the connection type and data type. For Arcadia connections, they include Sum, Count, Approx Distinct Count, Exact Distinct Count, Minimum, Maximum, Average, and String Concat.

The following steps demonstrate how to change the default aggregation function from Sum to Average for the field life_expectancy in the dataset World Life Expectancy [data source samples.world_life_expectancy].

  1. On the main navigation bar, click Data.

    Click DATA on main nav

    The Data view appears, open on the Datasets tab.

    Main landing page of DATA
  2. In the left navigation menu, click samples.
  3. In the Datasets area, select World Life Expectancy (samples.world_life_expectancy).

    selecting a dataset
    Selecting Dataset 'World Life Expectancy'
  4. In the Dataset Detail menu, select Fields.

    detail of 'World Life Expectancy'
    Dataset Detail for 'World Life Expectancy'
  5. In the Fields interface, select Edit Field.

    Editing Fields of Dataset 'World Life Expectancy'
    Editing the Fields of Dataset 'World Life Expectancy'
  6. Under Measures, find the field life_expectancy, and click the (down arrow) icon on its right side.

    From the menu, select Edit Fields.

    selecting edit field window
    Editing Field Properties
  7. The Edit Field Parameters window modal appears.

    Change Default Aggregation from Sum to Average, and click Apply.

    changing default aggregation
    Changing Default Aggregation
  8. Under Dataset: World Life Expectancy, click Save.

  9. As a result of this change, all new visuals created from this dataset will automatically use the new aggregation.

    To test this, click New Visual in the top left corner of the Dataset: World Life Expectancy page.

  10. On the left navigation, under Measures, pick up the field life_expectancy, and drag it to the Measures shelf.

    Notice that the field appears as avg(life_expectancy).

    altered column shows new default aggregation
    Default Aggregation Changed from Sum() to AVG()