This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Refines a WixDataAggregate
to contain the sum from each aggregation group.
The sum()
method refines a WixDataAggregate
to contain the sum of the
values from the specified field for each aggregated group or from the
whole collection if no group is defined.
When the aggregation is run()
, the returned WixDataAggregateResult
object contains an item for each group with the following key
projectedField
, the key is named
using that value. Otherwise, the key is named using the following format:
"fieldSum"
, where field
is the name of the specified field.Sums can only be calculated on fields of type Number.
Note: Aggregations can only be used on collections you have created. They cannot be used on Wix app collections.
Field in which to find the sum.
Name of the field in the aggregation results containing the sum.
This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Calculates the total sum of multiple expressions.
The sum()
method configures the aggregation pipeline to calculate the total sum of the specified expressions.
Expressions to calculate the total sum of. All expressions must resolve to numbers.
This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.