count
Returns the number of elements in a column.
Example
Count the total number of elements in the AMOUNT_SOLD.
count(Sales_Acme.Sales.AMOUNT_SOLD)
Count the number of elements in AMOUNT_SOLD as grouped by CITY.
count(Sales_Acme.Sales.AMOUNT_SOLD,byGroup(Sales_Acme.Sales.CITY))
Syntax
count(<object> expr, [groupBy(...)])
- expr : expression evaluating to any Incorta type
-
groupBy
: optional grouping functionReturns
long
or as manylong
s as there are groups ifgroupBy
is used
Notes
In the case the groupBy
argument is used, counts the number of items in each group. 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.