Previous Topic: Subgroup Aggregation With Entity QualifiersNext Topic: Subgroup Aggregation With Multiple Common Attributes


Subgroup Aggregation With Multiple Entities

Multiple entities in the read list of a SUMMARIZE EACH GROUP statement should have a relationship between them.

Use the following statement to find the total salary by departments:

SUMMARIZE EACH GROUP OF employee 
department 
WITH THE SAME department id 
PLACING department id INTO out department id 
PLACING GROUP sum(employee salary) INTO out employee salary 
WHERE DESIRED employee belongs to DESIRED department