Percent of Group Analytic Function

This article describes how to use the Percent of Group analytic function in CDP Data Visualization.

  1. Click the field on the measurement shelf, in this case, the sum(population) field on the Y Axis shelf.
  2. In the Field Properties menu, expand Analytic Functions, and select % of Group.
  3. In the Analytic Function: Percent of Group modal window,
    1. In Select aggregate for this measure, leave the default Sum. The other aggregation options are Count, Minimum, Maximum, and Average. In addition, some connection types also support Approximate Distinct Count and Exact Distinct Count.
    2. Under Select entities over which to calculate percentage, select year. This is the grouping that applies when calculating the percent of group.
  4. Click Apply.
  5. [Optional] If you examine the expression in the Enter/Edit Expression interface, it shows that the function has the following form:
    (sum([population]) / sum(sum([population])) over (partition by [year])) as 'percent(population)'
  6. Click Refresh Visual.
  7. Notice the change in the Y axis and tooltips, from displaying the sum(population) in millions to population as a percent.