count

count(T.A : bool) 🡒 number, aggregator

Counts the number of Boolean values that are true.

Example:

table T = with
  [| as A, as B |]
  [| true,  "a" |]
  [| true,  "a" |]
  [| true,  "b" |]
  [| false, "b" |]
  [| true,  "c" |]

table G[gdim] = by T.B

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

count(T.A : number) 🡒 number, aggregator

Counts the number of number values that are non-zero.

Example:

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

table G[gdim] = by T.B

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

count(T.A : text) 🡒 number, aggregator

Counts the number of text values that are non-empty.

Example:

table T = with
  [| as A, as B |]
  [| "foo",  "a" |]
  [| "bar",  "a" |]
  [| "qux",  "b" |]
  [| "",     "b" |]
  [| "bar",  "c" |]

table G[gdim] = by T.B

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