Count() returns the number of values aggregated in expression, as defined by a group by clause.
Return data type: integer
|expr||The expression or field containing the data to be measured.|
|distinct||If the word distinct occurs before the expression, all duplicates are disregarded.|
Examples and results:
Add the example script to your document and run it. Then add, at least, the fields listed in the results column to a sheet in our document to see the result.
LOAD * inline [
] (delimiter is '|');
LOAD Customer,Count(OrderNumber) as OrdersByCustomer Resident Temp Group By Customer;
As long as the dimension Customer is included in the table on the sheet, otherwise the result for OrdersByCustomer is 3, 2.
Given that the Temp table is loaded as in the previous example:
LOAD Count(OrderNumber) as TotalOrderNumber Resident Temp;
Given that the Temp table is loaded as in the first example:
LOAD Count(distinct OrderNumber) as TotalOrderNumber Resident Temp;
Because there are two values of OrderNumber with the same value, 1, and one null value.