sisense.com
✅ You are viewing documentation for the latest version of Compose SDK.
Version:

Function aggregate

aggregate( attribute, aggregationType, name?, format?): BaseMeasure

Creates an aggregated measure.

This is a base function to build other aggregation functions (e.g., sum, average, etc.) as listed in AggregationTypes.

Parameters

ParameterTypeDescription
attributeAttributeAttribute to aggregate
aggregationTypestringAggregation type. See AggregationTypes
name?stringOptional name for the new measure
format?stringOptional numeric formatting to apply using a Numeral.js format string. Can only be used for explicit queries. Cannot be used in charts, tables, etc.

Returns

BaseMeasure

A measure instance

Example

Calculate the total cost across all items in a category from the Sample Ecommerce data model.

measureFactory.aggregate(DM.Commerce.Cost, 'sum'),
Last Updated: