COUNT(DISTINCT): Calculating the Count of Distinct Values in a Field
COUNT(DISTINCT) calculates the count of the distinct values in a field.
Calculate the Count of the Distinct Values in a Field
COUNT(DISTINCT field)
where:
field
Is a numeric field on which to calculate the result.
Calculating the Average of a Field
The dminv table created by the ibi Data Migrator - General tutorial in the WebFOCUS Reporting Server browser interface contains the following sale price (PRICE) values:
179.00 399.00 199.00 999.00 899.00 249.00 279.00 399.00 319.00 399.00 349.00 129.00 109.00 169.00 89.00 499.00 299.00
COUNT(DISTINCT) calculates the average of the distinct values of PRICE.
COUNT(DISTINCT T1.PRICE)
The result is 15, while the count of all values is 17.