Modules

filter

 

Objects/Functions

module (N/query)

SuiteScript 2.0

query.Aggregate

query.Aggregate.{|AVERAGE,AVERAGE_DISTINCT,COUNT,COUNT_DISTINCT,MAXIMUM,MAXIMUM_DISTINCT,MEDIAN,MINIMUM,MINIMUM_DISTINCT,SUM,SUM_DISTINCT|}

N/query Module
query.Aggregate
Enum Description: Holds the string values for aggregate functions supported with the N/query Module. An aggregate function performs a calculation on the column or condition values and returns a single value. Each value in this enum (except MEDIAN) has two variants: distinct (using the _DISTINCT suffix) and nondistinct (using no suffix). The variant determines whether the aggregate function operates on all instances of duplicate values or on just a single instance of the value. For example, consider a situation in which the MAXIMUM aggregate function is used to determine the maximum of a set of values. When using the distinct variant (MAXIMUM_DISTINCT), the aggregate function considers each instance of duplicate values. So if the set of values includes three distinct values that are all equal and all represent the maximum value in the set, the aggregate function lists all three instances. When using the nondistinct variant (MAXIMUM), only one instance of the maximum value is listed, regardless of the number of instances of that maximum value in the set. This enum is used to pass the aggregate function argument to Component.createColumn(options), Component.createCondition(options), Query.createColumn(options), and Query.createCondition(options). JavaScript does not include an enumeration type. The SuiteScript 2.0 documentation utilizes the term enumeration (or enum) to describe the following: a plain JavaScript object with a flat, map-like structure. Within this object, each key points to a read-only string value.
Module: N/query Module
Sibling Module Members: N/query Module Members
Since: 2018.1
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=query.Aggregate

Example:

// Code Example 1
// Add additional code
//...
var myTransactionQuery = query.create({
type: query.Type.TRANSACTION
});

var myAggColumn = myTransactionQuery.createColumn({
fieldId: 'amount',
aggregate: query.Aggregate.AVERAGE
});

myTransactionQuery.columns = [myAggColumn];
//...
// Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_1510878932.html