--- title: "PostFunction" slug: "delta-percent" updated: 2022-11-08T13:16:08Z published: 2022-11-08T13:16:08Z canonical: "docs.datajet.app/delta-percent" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.datajet.app/llms.txt > Use this file to discover all available pages before exploring further. # delta(percent) ## PostFunction: [delta%] ### Returns the change between rows as a percentage of the total change between the first and last rows in the result-table. 1. Calculates the difference between current row and previous row *(deltaX)* 2. Calculates the total change between the last row in the data set and the first row in the data set (*TotalChange*) 3. Divides the difference for current row by the total change *(deltaX / TotalChange)* ## Purpose Use this function to: - See change as a percentage of overall change from first row to last row - Calculate percentage change contribution for each reporting per ## Calculation ```actionscript Delta% = Delta(X) / TotalChange Row(N) = "value for last row in resultset" Row(0) = "value for first row in resultset" Row(X) = "value for current row" Row(X-1) = "value for previous row" Delta(X) = Row(X) - Row(X-1) TotalChange = Row(N) - Row(0) ``` ## Sample Result ![deltapercent_sample](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/deltapercent_sample.PNG) ## Parameters | Input | Description | | --- | --- | | **Dimensions** | Discrete field(s). All fields must come from the same table. | | **Name** | Name to be displayed as Column Header in result grid | | **Measure** | The field to be used in the post-function calculation. Must be numeric if Function is anything other than COUNT. Must come from same table as DIMENSIONS. Supports Discrete or Continuous DataTypes. | | **Function** | COUNT / SUM / AVG / MIN / MAX / STDEV | | **Post** | **delta** | | ***Value*** | Optional. Filter to apply when evaluating FUNCTION. Only records in the Filter Recordset will be included in the Function and Post-Function calculations. Must come from same table as DIMENSION/MEASURE or be linked to the Dimension table. | | ***Axis*** | 0 / 1. Y-Axis to use when plotting graph. Default = 0 | | ***Plot*** | Y / N. Specifies whether measure’s output column should be plotted on graph. Default = Y | | ***Resolve*** | Optional. Resolve level for the measure. If blank, Resolve = Dimension Table | | ***Series Type*** | Default / Bar / Stacked Bar / Line / Spline / RangeLow / RangeHigh / CSLow / CSHigh / CSOpen / CSClose Determines the graph style for the measure. | | ***Popup*** | Default / None / Extended | | ***Prefix*** | $ / £ / E / % | ## Usage Notes 1. Calculates the difference between current row and previous row *(deltaX)* 2. Calculates the total change between the last row in the data set and the first row in the data set (*TotalChange*) 3. Divides the difference for current row by the total change *(deltaX / TotalChange)* ## Example Calculate monthly sales growth as a percentage of total change over the period. NoteMeasure 1 is included purely for illustration. It is not necessary to include this measure for the calculation to work | Dimension(s): | [Transactions].[YearMonth] | | --- | --- | | Measure 1 | - Name: =Sales This Month - Measure: = transactions.castprice - Function: =sum - Post: = - Value: = | - Axis: =0 - Plot:=Y - Resolve:= - Series Type:=Default - Popup:=Default - Prefix:= | | Measure 2 | - Name: =Monthly Change - Measure: =transactions.castprice - Function: =sum - **Post: =delta%** - Value: = | - Axis: =0 - Plot:=Y - Resolve:= - Series Type:=Default - Popup:=Default - Prefix:= | ![deltapercent_example1](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/deltapercent_example1.png) ![deltapercent_example2](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/deltapercent_example2.png) Here we can see that the period [200009 to 200010] had **17.83%** of the **total growth over the period.** ### See Also: - [Engineering](/v1/docs/engineering) - [Post Functions - Overview](/v1/docs/post-functions-overview) - [delta](/v1/docs/postfunction-delta)