Skip to content

CountDistinct

CountDistinct(column) · Aggregation

Counts distinct non-NULL values (SQL COUNT(DISTINCT col)). Over zero rows it returns 0.

Orders := CountDistinct(Sales.OrderId)
  • Not additive — it cannot be accumulated by YTD/RollingSum (SQX015): a sum of daily distinct counts double-counts repeat values.