Sometimes, the data in the base tables cannot be used directly, and must use an expression to change or "correct" it. For other use cases, you can create a calculation based on one or more fields. Instead of adding these expression for every visual, Arcadia Enterprise enables you to create new fields at the level of the dataset; they can then be used in visuals and dashboards, just the same as native data fields.
gdp
(gross
domenstic product) in the dataset World Life Expectancy [data source
samples.world_life_expectancy
]. We define it by the following
equation:gdp = gdp_per_capita x population
Note that Arcadia Enterprise supports three primary methods of editing fields at the dataset
level: Basic, Expression, and Display
Format. Here, we use make changes both on the Basic and
Expression tabs. We show how to use Display Format options in Changing the Field Display Format.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 Field.
Under Measures, find the field gdp_per_capita
,
and click the (down arrow) icon on
its right side.
From the menu, select Clone.
Under Measures, find the new cloned field Copy of
gdp_per_capita
, click the (down arrow) icon on its right side, and select Edit
Fields.
The Edit Field Parameters window modal appears.
The Edit Field Parameters modal supports three primary methods of editing fields; they match the three tabs of the modal: Basic, Expression, and Display Format.
In the Edit Field Parameters modal, under the Basic tab, make the following changes:
gdp
.gdp_per_capita * population
.Sum
.[gdp_per-capita] *
[population]
.Notice that the new calculated field has an equal sign notation, =.
Under Dataset: World Life Expectancy, click Save.
To test that the new calculated field works correctly, follow these steps:
Click New Dashboard in the top left corner of this interface.
In the new dashboard, click New Visual.
Hover over the top right corner of the visual, and click the (pencil/edit) icon.
In the Select the Combo visual type, and populate the shelves from the available fields (Dimensions, Measures, and so on) in the Data menu.
country
, and place it
on the Dimensions shelf.year
, and place it on
the Filters shelf. In the Filter for
year modal window, under the Value tab, select
the year 2010
.un_region
, and place
it on the Filters shelf. In the Filter for
un_region modal window, under the Value tab,
select Europe
.gdp_per_capita
, and
place it on the Bar Measure shelf.Under Measures, select gdp
, and place it on
the Line Measure shelf.
Click the (down arrow) on
GDP
field, and in the Field Properties,
under Axis, select Secondary Axis.
Click Refresh Visual.
As you can see, the two measurements appear on the graph, superimposed on each other: the
original gdp_per_capita
represented by the bars, and the calculated
gdp
, represented by the line.