Defining additional derived data
Next, define other derived data in the same shelf set-up and save it as
derived data LifeExpXPop
.
-
On the Dimensions shelf, place the
following fields:
un_region
,un_subregion
, andcountry
. -
Add the derived data
Pop
to the Dimensions shelf.You should do this because fields on the Measure shelf must be aggregated, but the definition ofPop
already includes the summation over thepopulation
field. -
Place the field
life_expectancy
on the Measures shelf and change the aggregate toavg(life_expectancy)
. -
Place the field
year
on the Filters shelf and change the expression to[year]=<<year_param:2000>>
. -
Duplicate Derived data
Pop
in place, on the Dimensions shelf. - Click the Down Arrow icon to the right of the cloned field and click Enter/Edit Expression in the dropdown.
-
In the Enter/Edit Expression modal
window, change the expression to
[life_expectancy]*[Pop]
and save it. -
Save the same field as derived data, named
LifeExpXPop
.You can see that in the Data menu, under Dimensions, you have a new category Derived Data that contains
LifeExpXPop
. -
To check the definition of the saved derived data
LifeExpXPop
, click the down arrow to the right of its name and click View Definition.The Derived Data Definition modal window appears. Note that the definition includes a parametrized filter foryear
, and thePop
derived data field. -
Replace the field on the Dimensions
shelf with the new derived data field, click
Refresh Visual, and
Save the application.
The visual should look similar to this one. Note that we aliased the fields and made some changes to display formats: