# Totals Component
The totals component is used put the result of aggretional operations, such count, average, and sum of the records.
# Aggregations Functions
Function | Description | arguments |
---|---|---|
definitionCount(definitionName,query,options={}) | counts the result of the given query in the given definition | definitionName:string,query:string,options:{} |
domainCount(domainName,query,options={}) | counts the result of the given query in the given domain | domainName:number,query:string |
fieldSum(defName,fieldName,query,options={}) | sums the values of the fieldName resulting from the given query in the given definition | defName:string, query:string, fieldName:string |
fieldAverage(defName,fieldName,query,options={}) | calculates the average of the values of field fieldName of the given query in the given definition | defName:string, query:string, fieldName:string |
fieldWeightedAverage(defName,fieldName,weightFieldName,query,options={}) | calculates the average weight of the values of field fieldName applying the weights of weightFieldName of the given query in the given definition | defName:string, fieldName:string, weightFieldName:string, query:string, fieldName:string |
# Options Argument
After the Definition Name and Query arguments, the third field is for the additional options, which are not mandatory.
For example, in order to add a refresh time of 10 seconds to the definition counts of totals, you need to add the following argument:
{"validity":10 }