This article describes how to use the Previous Value analytic function in Arcadia Enterprise.
We are using the Basic Visual for Aggregates to demonstrate how to use the Previous Value analytic function.
sum(population)
field on the Y Axis shelf.In the Analytic Function: Previous Value modal window,
Under Select the sort order, click the (add/plus) icon, select year, and then set it to ascending sort order. This order specifies what determines what the previous row is, and the row where the value is taken.
Note that you can add additional sort parameters, by clicking the (add/plus) icon.
Under Offset, specify the number of previous rows over which the function executes.
[Optional] If you examine the expression in the Enter/Edit Expression interface, it shows that the function has the following form:
LAG(sum([population]), 1) over (partition by [year] order by [year], [country])
as 'previous value(population)'
Click Refresh Visual.
Notice the change to the appearance of the visual, and the change in values that appear on the tooltip.