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

Function sum

sum( attribute, name?, format?): BaseMeasure

Creates a sum aggregation measure over the given attribute.

To create a running sum, use runningSum.

Parameters

ParameterTypeDescription
attributeAttributeAttribute to aggregate
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.sum(DM.Commerce.Cost)
Last Updated: