Using Derived Data
To use the derived data measurements in a calculation, treat is as any other
measurement. In the example used here, we use the derived data
LifeExpXPop to accurately calculate the weighted life
expectancy for an aggregation dimension, such as UN Region or UN Subregion. We do
this by dividing the sum of Life Expectancy X Population by
sum(population) at the appropriate aggregate level.
Place the following fields on the Dimensions shelf:
Add the derived data field
Place the field
yearon the Filters shelf , and change the expression to
Place the derived data field
LifeExpXPoponto the Meausres shelf. Notice that it appears as an aggregation,
Using the Enter/Edit Expression window modal, change the
definition of the field as follows, and click Save.
Notice that we aliased the field.
(sum([LifeExpXPop])/sum([population])) as 'Weighted Life Expectancy'
- Optional: Use the Alias option to change the column names to UN Region, UN Subregion
Click Refresh Visual.
The visual should look similar to this one:
[Optional] To see the correctly calculated Life Expectancy for a UN
Region, simply remove UN Subregion from the Dimensions