You may find it useful to change the basic attribute 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 following steps demonstrate how to change the default aggregation function from Sum to Average for the column life_expectancy
in 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 Attributes.
In the Attributes area, select Edit Attributes.
Under Measures, find the field life_expectancy
, and click the down arrow on its right side.
From the menu, select Edit Attributes.
The Edit Table Column Properties 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)
.