Using derived data

To use the derived data measurements in a calculation, treat it as any other measurement. In this example, the derived data LifeExpXPop is used to accurately calculate the weighted life expectancy for an aggregation dimension, such as UN Region or UN Subregion. You can do this by dividing the sum of Life Expectancy X Population by sum(population) at the appropriate aggregate level.

  1. Place the following fields on the Dimensions shelf: un_region and un_subregion.
  2. Add the derived data field Pop.
  3. Place the field year on the Filters shelf , and change the expression to [year]=<<year_param:2000>>.
  4. Place the derived data field LifeExpXPop onto the Meausres shelf. Notice that it appears as an aggregation, sum(LifeExpXPop).
  5. Using the Enter/Edit Expression window modal, change the definition of the field as follows,and click Save.
    You can see that the field has been aliased.
    (sum([LifeExpXPop])/sum([population])) as 'Weighted Life Expectancy'
  6. Optional: Use the Alias option to change the column names to UN Region, UN Subregion
  7. Click Refresh Visual.

    The visual should look similar to this one:

  8. [Optional] To see the correctly calculated Life Expectancy for a UN Region, remove UN Subregion from the Dimensions shelf.