| 
    QGIS API Documentation
    3.14.0-Pi (9f7028fd23)
    
   | 
 
 
 
 
Go to the documentation of this file.
   18 #ifndef QGSAGGREGATECALCULATOR_H 
   19 #define QGSAGGREGATECALCULATOR_H 
   21 #include "qgis_core.h" 
   87       StringConcatenateUnique 
 
  138     void setFilter( 
const QString &filterExpression ) { mFilterExpression = filterExpression; }
 
  152     QString 
filter()
 const { 
return mFilterExpression; }
 
  159     void setDelimiter( 
const QString &delimiter ) { mDelimiter = delimiter; }
 
  176     QVariant calculate( Aggregate aggregate, 
const QString &fieldOrExpression,
 
  185     static Aggregate stringToAggregate( 
const QString &
string, 
bool *ok = 
nullptr );
 
  192     static QList< QgsAggregateCalculator::AggregateInfo > aggregates();
 
  200     QString mFilterExpression;
 
  212     bool mFidsSet = 
false;
 
  231     static QVariant calculate( Aggregate aggregate, 
QgsFeatureIterator &fit, QVariant::Type resultType,
 
  233                                const QString &delimiter,
 
  238     QVariant defaultValue( Aggregate aggregate ) 
const;
 
  241 #endif //QGSAGGREGATECALCULATOR_H 
  
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
 
QString delimiter
Delimiter to use for joining values with the StringConcatenate aggregate.
 
@ Range
Range of values (max - min) (numeric and datetime fields only)
 
QString name
A translated, human readable name.
 
Utility class for calculating aggregates for a field (or expression) over the features from a vector ...
 
QString filter() const
Returns the filter which limits the features used during the aggregate calculation.
 
@ Minority
Minority of values.
 
A bundle of parameters controlling aggregate calculation.
 
@ CountDistinct
Number of distinct values.
 
@ CountMissing
Number of missing (null) values.
 
@ ArrayAggregate
Create an array of values.
 
QgsFeatureRequest::OrderBy orderBy
Optional order by clauses.
 
@ InterQuartileRange
Inter quartile range (IQR) (numeric fields only)
 
@ StDevSample
Sample standard deviation of values (numeric fields only)
 
QString delimiter() const
Returns the delimiter used for joining values with the StringConcatenate aggregate.
 
void setFilter(const QString &filterExpression)
Sets a filter to limit the features used during the aggregate calculation.
 
@ StDev
Standard deviation of values (numeric fields only)
 
Statistic
Enumeration of flags that specify statistics to be calculated.
 
@ StringMinimumLength
Minimum length of string (string fields only)
 
Statistic
Enumeration of flags that specify statistics to be calculated.
 
QSet< QVariant::Type > supportedTypes
This aggregate function can only be used with these datatypes.
 
@ Median
Median of values (numeric fields only)
 
QSet< QgsFeatureId > QgsFeatureIds
 
@ StringConcatenate
Concatenate values with a joining string (string fields only). Specify the delimiter using setDelimit...
 
@ Mean
Mean of values (numeric fields only)
 
Statistic
Enumeration of flags that specify statistics to be calculated.
 
@ ThirdQuartile
Third quartile (numeric fields only)
 
Aggregate
Available aggregates to calculate.
 
@ Majority
Majority of values.
 
Structured information about the available aggregates.
 
@ FirstQuartile
First quartile (numeric fields only)
 
QString filter
Optional filter for calculating aggregate over a subset of features, or an empty string to use all fe...
 
@ GeometryCollect
Create a multipart geometry from aggregated geometries.
 
void setDelimiter(const QString &delimiter)
Sets the delimiter to use for joining values with the StringConcatenate aggregate.
 
@ StringMaximumLength
Maximum length of string (string fields only)