We are using US Census
data to create a visual that uses the Percent of Group analytic function.
To use the Percent of Group analytic function with US Census
data, follow the steps in the Example.
US Census
dataset, download the census-pop.csv.zip file, uncompress it, Importing Data, and Creating Datasets.The input set up for the Percent of Group visuals follows:
state
sum(population)
, for nowyear
sum(population)
, sum(year)
On the Y shelf, click the icon to the right of the variable.
In the dropdown, hover over Analytic Functions.
In the Analytical Function: Percent of Group modal window,
Click Refresh Visual.
Note the expression used for calculating the percent of group:
sum([population]) / sum(sum([population])) over (partition by [state]) as 'percent(population)'
Follow these general steps to create a percent of group visual:
When creating or editing a visual, determine for which field variable you must apply an analytic function.
The shelves that support analytic functions depend on the visual type, and are typically available for X and Y axes, Measures, Dimensions, Colors, and Tooltips.
Click the icon to the right of the variable.
In the dropdown, click Analytic Functions.
From the Analytic Functions menu, select Percent of Group.
In the Analytic Function: Percent of Group modal window, in Select entities over which to calculate percentage, choose one of: