We are using US Census
data to create a visual that uses the Running Total analytic function.
To use the Running Total analytic function with US Census
data, follow the
general steps in the Example.
US Census
dataset, download the census-pop.csv.zip file, uncompress it, import the data into Arcadia, and create the dataset.The input set up for the Running Total visual follows:
state
sum(population)
, for nowyear
sum(population)
, sum(year)
Filters shelf: exclude the following years of the census: 1790
and 1800
.
There is insufficient data for these years, and it skews the results.
On the Y shelf, click the icon to the right of the variable.
In the dropdown, hover over Analytic Functions.
In the Analytic Function: Running Total modal window,
Under Select the sort order, click the (add/plus) icon, select year, and then set it to ascending sort order.
Note that you can add additional sort parameters, by clicking the (add/plus) icon.
Click Refresh Visual.
Note the expression used for calculating the running total:
sum(sum([population])) over (partition by [state] order by [year] rows between unbounded preceding and current row) as 'running total(population)'
Follow these general steps to create a running total 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 Analytical Functions menu, select Running total.
The Analytic Function: Running Total modal window appears.
In the Analytical Function: Running Total modal window, in Select aggregate for this measure, choose one of:
[Optional] Under Select the sort order, specify the sort order. If you don't specify it, the current column's aggregate is the sort order.