FireDAC.Comp.DataSet.TFDAggregate.GroupingLevel

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property GroupingLevel: Integer read FGroupingLevel write SetGroupingLevel default 0;

C++

__property int GroupingLevel = {read=FGroupingLevel, write=SetGroupingLevel, default=0};

Properties

Type Visibility Source Unit Parent
property published
FireDAC.Comp.DataSet.pas
FireDAC.Comp.DataSet.hpp
FireDAC.Comp.DataSet TFDAggregate

Description

Specifies the set of records in the group.

Use GroupingLevel to define the set of records in the group. The calculation of the aggregated value is performed for each group of records separately. 

GroupingLevel is the number of indexed fields. This number is the subset of all indexed fields in the current dataset index. All records in the group have the same value of these first GroupingLevel indexed fields. The value 0 means all dataset records.

Example

FDQuery1.IndexFieldNames : = 'ORDER_NO;PART_NO';

FDQuery1.AggregatesActive := True;

// calculate number of rows in each order
FDQuery1.Aggregates[0].Expression := 'COUNT(*)';
FDQuery1.Aggregates[0].GroupingLevel := 1;

FDQuery1.Aggregates[0].Active := True;

See Also