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 Population by sum(population) at the appropriate aggregate level.

  1. Place the following fields on the Dimensions shelf: un_region and un_subregion. Add the derived data field Pop.
  2. Place the field year on the Filters shelf , and change the expression to [year]=<<year_param:2000>>.
  3. Place the derived data field LifeExpXPop onto the Meausres shelf. Notice that it appears as an aggregation, sum(LifeExpXPop).

    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'
  4. [Optional] Use the Alias option to change the column names to UN Region, UN Subregion
  5. Click Refresh Visual.

    The visual should look similar to this one:

    using derived data measurements in a calculation
  6. [Optional] To see the correctly calculated Life Expectancy for a UN Region, simply remove UN Subregion from the Dimensions shelf.

    viewing the correctly calculated Life Expectancy for a UN Region