Skip to main content

GROUP keyword

GROUP

The GROUP keyword is used within output format parameter (RECORD Structure) of a TABLE definition where optional group by expressions are also present. GROUP replaces the recordset parameter of any aggregate built-in function used in the output to indicate the operation is performed for each group of the expression. This is similar to an SQL "GROUP BY" clause. The most common usage is to output a table as a crosstab report.

There is also a GROUP built-in function which provides a similar functionality.

Example:

A := TABLE(Person,{per_st,per_sex,COUNT(GROUP)},per_st,per_sex);
             // create a crosstab report of each sex in each state

See Also: TABLE, COUNT, AVE, MAX, MIN, SUM, VARIANCE, COVARIANCE, CORRELATION, COMBINE