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
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 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.
In the Edit Field Parameters modal, make the following changes:
gdp
.gdp_per_capita * population
.Sum
.[gdp_per-capita] *
[population]
.When the Validation Successful message appears on the modal, click Apply.
Notice that the new calculated field has an equal sign notation, =.
Under Dataset: World Life Expectancy, click Save.
To test this, click New Visual in the top left corner of this interface.
Select the Combo visual type, and populate the shelves from the available fields (Dimensions, Measures, and so on) in the Data menu.
county
, and place it
on the Dimensions shelf.year
, and place it on
the Fileters shelf. In the Filter for year
modal window, under the Value tab, select the year
2010
.un_region
, and place
it on the Fileters 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.