Previous Topic: Add SUMMARIZE EACH Entity ActionNext Topic: Group Aggregation TARGETING Repeating Group Views


Group Aggregation Without Selection Criteria

The aggregate function COUNT, when used with OCCURRENCES, is used to count the number of entities in each group. The keyword, GROUP, preceding this function indicates that a new value for the function is computed for each iteration.

In the following example, the SUMMARIZE EACH statement finds the number of employees for each job grade:

SUMMARIZE EACH GROUP OF employee 
WITH THE SAME employee job_grade 
PLACING employee_job_grade INTO local employee job_grade 
PLACING GROUP count(OCCURRENCES) INTO local ief_supplied count 

Note: The SUMMARIZE EACH statement requires all common attributes designated in the WITH THE SAME clause to appear in PLACING clauses before the aggregate functions. For this example, the counts and corresponding Job Grades for each subgroup is stored in the designated local views, and retrieved in ascending Job Grade sequence because there is no SORTED BY clause.