18 #ifndef QGSAGGREGATECALCULATOR_H 
   19 #define QGSAGGREGATECALCULATOR_H 
   21 #include "qgis_core.h" 
   90       StringConcatenateUnique 
 
  141     void setParameters( 
const AggregateParameters ¶meters );
 
  148     void setFilter( 
const QString &filterExpression ) { mFilterExpression = filterExpression; }
 
  162     QString 
filter()
 const { 
return mFilterExpression; }
 
  169     void setDelimiter( 
const QString &delimiter ) { mDelimiter = delimiter; }
 
  188     QVariant calculate( Aggregate aggregate, 
const QString &fieldOrExpression,
 
  197     static Aggregate stringToAggregate( 
const QString &
string, 
bool *ok = 
nullptr );
 
  203     static QString displayName( Aggregate aggregate );
 
  210     static QList< QgsAggregateCalculator::AggregateInfo > aggregates();
 
  218     QString mFilterExpression;
 
  230     bool mFidsSet = 
false;
 
  232     mutable QString mLastError;
 
  251     static QVariant calculate( Aggregate aggregate, 
QgsFeatureIterator &fit, QVariant::Type resultType, 
int userType,
 
  253                                const QString &delimiter,
 
  258     QVariant defaultValue( Aggregate aggregate ) 
const;
 
Utility class for calculating aggregates for a field (or expression) over the features from a vector ...
void setFilter(const QString &filterExpression)
Sets a filter to limit the features used during the aggregate calculation.
void setDelimiter(const QString &delimiter)
Sets the delimiter to use for joining values with the StringConcatenate aggregate.
QString lastError() const
Returns the last error encountered during the aggregate calculation.
QString filter() const
Returns the filter which limits the features used during the aggregate calculation.
Aggregate
Available aggregates to calculate.
@ StDev
Standard deviation of values (numeric fields only)
@ StringMaximumLength
Maximum length of string (string fields only)
@ ThirdQuartile
Third quartile (numeric fields only)
@ Range
Range of values (max - min) (numeric and datetime fields only)
@ ArrayAggregate
Create an array of values.
@ InterQuartileRange
Inter quartile range (IQR) (numeric fields only)
@ FirstQuartile
First quartile (numeric fields only)
@ Median
Median of values (numeric fields only)
@ GeometryCollect
Create a multipart geometry from aggregated geometries.
@ CountMissing
Number of missing (null) values.
@ StDevSample
Sample standard deviation of values (numeric fields only)
@ Majority
Majority of values.
@ StringConcatenate
Concatenate values with a joining string (string fields only). Specify the delimiter using setDelimit...
@ Mean
Mean of values (numeric fields only)
@ StringMinimumLength
Minimum length of string (string fields only)
@ CountDistinct
Number of distinct values.
@ Minority
Minority of values.
QString delimiter() const
Returns the delimiter used for joining values with the StringConcatenate aggregate.
Statistic
Enumeration of flags that specify statistics to be calculated.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Class for parsing and evaluation of expressions (formerly called "search strings").
Wrapper for iterator of features from vector data provider or vector layer.
Represents a list of OrderByClauses, with the most important first and the least important last.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Statistic
Enumeration of flags that specify statistics to be calculated.
Statistic
Enumeration of flags that specify statistics to be calculated.
Represents a vector layer which manages a vector based data sets.
QSet< QgsFeatureId > QgsFeatureIds
Structured information about the available aggregates.
QString name
A translated, human readable name.
QSet< QVariant::Type > supportedTypes
This aggregate function can only be used with these datatypes.
A bundle of parameters controlling aggregate calculation.
QString filter
Optional filter for calculating aggregate over a subset of features, or an empty string to use all fe...
QString delimiter
Delimiter to use for joining values with the StringConcatenate aggregate.
QgsFeatureRequest::OrderBy orderBy
Optional order by clauses.