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 datatype. 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
].
On the main navigation bar, click Data.
The Data view appears, open on the Datasets tab.
In the Datasets area, select
World Life Expectancy
(samples.world_life_expectancy)
.
In the Dataset Detail menu, select Fields.
In the Fields interface, select Edit Fields.
Under Measures, find the field life_expectancy
, and click the (down arrow) icon on its right side.
From the menu, select Edit Fields.
The Edit Field Parameters window modal appears.
Change Default Aggregation from Sum to Average, and click Apply.
Under Dataset: World Life Expectancy, click Save.
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.
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)
.