distinct
Returns the number of distinct elements in a column.
Examples
Determine the number of different (distinct) models sold.
distinct(Sales_Acme.Sales.model_name)
Determine the number of different models sold by city.
distinct(Sales_Acme.Sales.model_name, byGroup(Sales_Acme.Sales.city))
Syntax
distinct(<object> expr, [groupBy(...)])
- expr : any Incorta data type
-
groupBy
: optional grouping functionReturns
long
or as manylong
s as there are groups ifgroupBy
is used
Notes
You must include all the leading grouping dimensions in the Insight from the top-down to the level-based measure you want to evaluate. See Aggregation with Level Based Measure in Aggregating Functions.