Query.Datagrid.Aggregate.groupSumList()

Signature

Object groupSumList(String resultSetName, String entityUri, String fieldName, String filter, String... groupByFieldNames)

Domain

QUERY, ACTION

Parameters

NameTypeDescription
resultSetNameStringThe resultset name
entityUriStringThe entity uri.
fieldNameStringName of the field used for computation.
filterStringCondition to be satisfied by the entities in the result.
groupByFieldNamesString...Names of the fields in groupBy clause.

Returns

TypeDescription
ObjectReturn a List of rows. Each row may be a single Object column or an Object[] of columns.

Cautions

none

Example

String resultSetName = "groupSumListRS" ;
Object resultSet = Query.Datagrid.Aggregate.groupSumList(resultSetName, "/Concepts/Employee","exp","age < 4", "age", "dept");
//Iterate over the result set
while(Query.Util.sizeOfList(resultList) > 0){
    Object[] s = Query.Util.removeFromList(resultList, 0);
    /* s[0]-- age, s[1]-- exp, s[2]-- sum of exp of the employee entities
    satisfying the filter condition for this age and exp */
    System.debugOut(resultSetName + " :: " + s[0] + " : "+ s[1] + " : "+ s[2]);
}