Supported aggregations

Last updated:

|Edit this page

The following aggregations are enabled. This list is ever expanding. Please submit a pull request if we're missing something obvious.

Standard aggregate functions

  • count
  • countIf
  • min
  • minIf
  • max
  • maxIf
  • sum
  • sumIf
  • avg
  • avgIf
  • any
  • anyIf
  • stddevPop
  • stddevPopIf
  • stddevSamp
  • stddevSampIf
  • varPop
  • varPopIf
  • varSamp
  • varSampIf
  • covarPop
  • covarPopIf
  • covarSamp
  • covarSampIf

ClickHouse-specific aggregate functions

  • anyHeavy
  • anyHeavyIf
  • anyLast
  • anyLastIf
  • argMin
  • argMinIf
  • argMax
  • argMaxIf
  • avgWeighted
  • avgWeightedIf
  • groupArray
  • groupUniqArray
  • groupArrayInsertAt
  • groupArrayInsertAtIf
  • groupArrayMovingAvg
  • groupArrayMovingAvgIf
  • groupArrayMovingSum
  • groupArrayMovingSumIf
  • groupBitAnd
  • groupBitAndIf
  • groupBitOr
  • groupBitOrIf
  • groupBitXor
  • groupBitXorIf
  • groupBitmap
  • groupBitmapIf
  • groupBitmapAnd
  • groupBitmapAndIf
  • groupBitmapOr
  • groupBitmapOrIf
  • groupBitmapXor
  • groupBitmapXorIf
  • sumWithOverflow
  • sumWithOverflowIf
  • deltaSum
  • deltaSumIf
  • deltaSumTimestamp
  • deltaSumTimestampIf
  • sumMap
  • sumMapIf
  • minMap
  • minMapIf
  • maxMap
  • maxMapIf
  • skewSamp
  • skewSampIf
  • skewPop
  • skewPopIf
  • kurtSamp
  • kurtSampIf
  • kurtPop
  • kurtPopIf
  • uniq
  • uniqIf
  • uniqExact
  • uniqExactIf
  • uniqHLL12
  • uniqHLL12If
  • uniqTheta
  • uniqThetaIf
  • simpleLinearRegression
  • simpleLinearRegressionIf
  • contingency
  • contingencyIf
  • cramersV
  • cramersVIf
  • cramersVBiasCorrected
  • cramersVBiasCorrectedIf
  • theilsU
  • theilsUIf
  • maxIntersections
  • maxIntersectionsIf
  • maxIntersectionsPosition
  • maxIntersectionsPositionIf

Questions?

Was this page useful?

Next article

HogQL tutorials

Examples How to do time-based breakdowns (hour, minute, real time) in HogQL The power of HogQL's sum() aggregation Using HogQL for advanced time and date Using HogQL for advanced breakdowns How to filter and breakdown arrays with HogQL Analyzing events How to analyze autocapture events with HogQL How to analyze first and last touch attribution How to calculate time on page with HogQL How to calculate bounce rates with HogQL

Read next article