avg

avg(T.a : number) 🡒 number, aggregator

The aggregator returns the numerical average of the grouped numbers.

Example:

table T = with
  [| as A, as B |]
  [| 0,   "a"   |]
  [| 0,   "a"   |]
  [| 0,   "b"   |]
  [| 1,   "b"   |]
  [| 1,   "c"   |]

table G[gdim] = by T.B

where T.B != "c"
  show table "" a1b4 with
    gdim
    avg(T.A)
    group by gdim

The aggregator returns 0 on empty groups.