Class: module:crm/Aggregate

module:crm/Aggregate()

Aggregate functions. Currently used in metric widgets.

Constructor

new module:crm/Aggregate()

Source:

Methods

(static) avg(data) → {Number}

Average

Parameters:
Name Type Description
data Array

Array of objects that contain a value property

Source:
Returns:
Type
Number

(static) count(data) → {Number}

Count

Parameters:
Name Type Description
data Array

Array of objects that contain a value property

Source:
Returns:
Type
Number

(static) first(data)

First

Parameters:
Name Type Description
data Array

Array of objects that contain a value property

Source:
Returns:

The first elements "value" property value

(static) last(data)

Last

Parameters:
Name Type Description
data Array

Array of objects that contain a value property

Source:
Returns:

The last elements "value" property value

(static) max(data) → {Number}

Maximum

Parameters:
Name Type Description
data Array

Array of objects that contain a value property

Source:
Returns:
Type
Number

(static) min(data) → {Number}

Minimum

Parameters:
Name Type Description
data Array

Array of objects that contain a value property

Source:
Returns:
Type
Number

(static) sum(data) → {Number}

Sum

Parameters:
Name Type Description
data Array

Array of objects that contain a value property

Source:
Returns:
Type
Number