This article describes how to use the Percent Difference from Next Value analytic function in Arcadia Enterprise.
We are using the Basic Visual for Aggregates to demonstrate how to use the Percentage Difference from Next Value analytic function.
sum(population)
field on the Y Axis shelf.In the Analytic Function: Percentage Difference from Next Value modal window,
Under Select the sort order, you can specify the order of sorting. This order specifies what the next row is, and the row where the value is taken. If your visual already specifies sorting order, these values appear in the modal.
You can add additional sort parameters, by clicking the (add/plus) icon.
Here, edit the sort order to be: country ascending, followed by year ascending.
[Optional] If you examine the expression in the Enter/Edit Expression interface, it shows that the function has the following form:
(sum([population]) - LAG(sum([population]), 1)
over (partition by [country] order by [country], [year])) / LAG(sum([population]), 1)
over (partition by [country] order by [country], [year])
as 'pct diff from next(population)'
Click Refresh Visual.
Notice the change in the Y axis and tooltips, from displaying the
sum(population)
in millions to population
as a
percentage difference from next value.