Easy to Create, Easy to Change - Easy to use!

Support::

in groups



Parameters


Returns/Result


Examples


Reference

in groups

Type

Grouping Operator

Purpose

The in groups operator groups records and generates statistical totals for each group if any other statistic is requested by the query.

Note: the variation ?in groups with group-totals? is included for compatibility with previous version of DataEase. Either version will include statistics if they are required

Syntax

FIELDNAME in groups [with group-totals] ;

Usage

The in groups operator can be used only on list items following the list records command. It cannot be used with the enter a record, modify records, or delete records commands.

In the procedure output, the group identifier appears only once at the beginning of a group. If statistics are specified for any output fields, group subtotals for those fields are included in the output.

An item to be processed in groups with group-totals should be listed before all other output items in a script, including items to be sorted in order. When a field is listed in groups with group-totals, DataEase also sorts the groups in order (e.g., when grouping MEMBERS by STATE, all California members are listed before any Colorado members).

 

Caution

Grouping operators cannot be used with the all relational operator (i.e., if RESERVATIONS is the Primary table, you cannot use the query statement: all MEMBERS STATE in groups.

Example

for MEMBERS ;

list records

STATE in groups ;

LASTNAME in order ;

TOTALDUE : item sum .

end

 

This script tells DataEase: (1) Process all MEMBERS records with the same value in the STATE field as a group, (2)display the group identifier (STATE) once at the beginning of each group, (3) within each group, arrange the members alphabetically by LAST NAME, and (4) list each member's TOTAL DUE, the subtotal for each STATE group, and the sum of all the TOTAL DUE amounts combined. The output from this query might look as follows:

 

 

State

Last Name

Total Due

...

...

...

DC

 

 

 

Dowling

$115.00

 

Schmidt

$85.00

 

Spinelli

$100.00

 

Group Total:

$300.00

DE

 

 

 

Gross

$35.00

 

Stromboulis

$70.00

 

Group Total:

$105.00

...

...

...

 

Grand Total:

$405.00

 

See Also


On the forum about in groups

On the blog about in groups