FireDAC.Comp.DataSet.TFDAggregate.GroupingLevel

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type: property
Visibility: published
Source:
FireDAC.Comp.DataSet.pas
FireDAC.Comp.DataSet.hpp
Unit: FireDAC.Comp.DataSet
Parent: TFDAggregate

Delphi

property GroupingLevel: Integer read FGroupingLevel write SetGroupingLevel default 0;

C++

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

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