Aggregation Functions

Aggregation Functions

Article Type: How-To Audience: Developers, App Admins Module: How To

Numeric aggregation functions available in JSONata expressions throughout the Fuuz platform.

$sum()

Signature: $sum(array)

Returns the arithmetic sum of an array of numbers. It is an error if the input array contains an item which isn't a number.

Example

  • $sum([5,1,3,7,4]) => 20

$max()

Signature: $max(array)

Returns the maximum number in an array of numbers. It is an error if the input array contains an item which isn't a number.

Example

  • $max([5,1,3,7,4]) => 7

$min()

Signature: $min(array)

Returns the minimum number in an array of numbers. It is an error if the input array contains an item which isn't a number.

Example

  • $min([5,1,3,7,4]) => 1

$average()

Signature: $average(array)

Returns the mean value of an array of numbers. It is an error if the input array contains an item which isn't a number.

Example

  • $average([5,1,3,7,4]) => 4

See Also

    • Related Articles

    • Boolean Functions

      Article Type: How-To Audience: Developers, App Admins Module: How To Standard JSONata Boolean functions available in expressions throughout the Fuuz platform. $boolean() Signature: $boolean(arg) Casts the argument to a Boolean using the following ...
    • Sorting Grouping and Aggregation

      Sorting, Grouping and Aggregation Fuuz Context Where this applies in Fuuz: Sorting, grouping, and aggregation are core to building rollups in Fuuz Pipelines—e.g., summarizing production counts per SKU, batching work orders, and preparing totals ...
    • Array Functions (Standard JSONata)

      Article Type: How-To Audience: Developers, App Admins Module: How To Standard JSONata array functions available in expressions throughout the Fuuz platform. Note: This page covers the standard JSONata array functions. For Fuuz-specific custom ...
    • Higher Order Functions

      Higher order functions $map() Signature: $map(array, function) If the input argument is an array of 2 or more elements, returns an array containing the results of applying the function parameter to each value in the array parameter. $map([1,2,3], ...
    • Numeric Functions

      Numeric functions $number() Signature: $number(arg) Casts the arg parameter to a number using the following casting rules - Numbers are unchanged - Strings that contain a sequence of characters that represent a legal JSON number are converted to that ...