Skip to main content

percentageChangeAcrossSeries

Calculates the percentage change between the first and last values in a series of numbers.

The input must be a one-dimensional table region (e.g. a column).

Like direction, this function is often used with time-series data such as a series of stock prices.

Note

Available in "Describe the Table" and "Describe Row in Context" projects only.

Parameters

  • SERIES (table region)

    A one-dimensional table region of numbers (e.g. column).

  • NUMBER OF DECIMALS (number or string)

    Optional. The number of decimal places for the result.

    You can set the default for this parameter in your project settings. If set to useNumberFormat, the number of decimal places is taken from your project's default number format pattern.

    Default: useNumberFormat

  • STRIP TRAILING ZEROS (Boolean or string)

    Optional. Whether to strip trailing zeros from the result (true) or leave them in place (false).

    You can set the default for this parameter in your project settings. If set to useNumberFormat, the decision to strip or retain trailing zeros is taken from your project's default number format pattern.

    Default: useNumberFormat

Important

The default values above are the system defaults. You can change these defaults in your project's Settings view. See Settings > Number and Currency for guidance.

Examples

Assume the settings in Settings > Number and Currency are:

Setting

Value

NUMBER FORMAT

#,##0.##

DECIMAL PLACES FOR PERCENTAGECHANGEACROSSSERIES

useNumberFormat

STRIP TRAILING ZEROS FOR PERCENTAGECHANGEACROSSSERIES

useNumberFormat

Assume a "Describe the Table" project with this data:

 

Month

Price

Row 1

January

44.99

Row 2

February

43.56

Row 3

March

45.10

If the optional parameters are unspecified, the project settings apply.

ATL in Script

Result

[[percentageChangeAcrossSeries(Price)]]

0.24

Use the second parameter to specify the number of decimal places.

ATL in Script

Result

[[percentageChangeAcrossSeries(Price, 3)]]

0.244

[[percentageChangeAcrossSeries(Price, 7)]]

0.2444988

Set the third parameter to false to include trailing zeros.

ATL in Script

Result

[[percentageChangeAcrossSeries(Price, 5)]]

0.2445

[[percentageChangeAcrossSeries(Price, 5, false)]]

0.24450

Note

In a "Describe Row in Context" project, the column variable is PriceColumn.