Query.Datagrid.Aggregate.groupCountList()
Signature
Object groupCountList(String resultSetName, String entityUri, String filter, String... groupByFieldNames)
Description
Count the number of entities of the specified URI, which satisfies the condition in the filter for each group.
Parameters
Name | Type | Description |
resultSetName | String | The resultset name |
entityUri | String | The entity uri. |
filter | String | Condition to be satisfied by the entities in the result. |
groupByFieldNames | String... | Names of the fields in groupBy clause. |
Returns
Type | Description |
Object | Return a List of rows. Each row may be a single Object column or an Object[] of columns. |
Example
String resultSetName = "groupCountListRS" ;
Object resultSet = Query.Datagrid.Aggregate.groupCountList(resultSetName, "/Concepts/Employee","age < 4", "age", "exp");
//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]-- count of the employee entities
    satisfying the filter condition for this age and exp */
    System.debugOut(resultSetName + " :: " + s[0] + " : "+ s[1] + " : "+ s[2]);
}