Difference
Computes the change from one row to the next: each value minus the value before it. Use it to turn levels into movements, such as month-over-month revenue change in dollars or the daily change in a cash balance. The first row is 0, since there is no prior period to compare.
Inputs
| Input | Accepts | Required |
|---|---|---|
Series | Series (a list of numbers) | Yes |
Outputs
| Output | Produces |
|---|---|
Result | Series (a list of numbers) |
Example
A Monthly_Revenue column reads 500,000, 525,000, 510,000, 560,000. Difference produces 0, 25,000, -15,000, 50,000: the dollar change each month. Chart it as bars to see at a glance which months grew and which slipped, or run it through Abs and Aggregate (Max) to find the single largest swing of the year.
Tips
Difference gives the change in dollars; PercentChange gives it as a growth rate. Rows must be in period order for the comparison to make sense; add a Sort node upstream if they are not.