You are viewing content for 5.0 | 4.9 | 4.8 | 4.7 | 4.6 | 4.5 | 4.4 | 4.3 | Previous Releases


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 function

    Returns

    long or as many longs as there are groups if groupBy 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.


© Incorta, Inc. All Rights Reserved.