Function
Description
This function is used to count the number of distinct values referred to by the first argument together. The second argument, if there is one, gives the group by field name.
Arguments
Return type
Returns a Number value.
Examples
Number x = DistinctCount([1.0, 1.0, 3.0, 4.5, 4.5, 67.0]) // result is 4Number x[6] = [1.0, 1.0, 3.0, 4.5, 4.5, 67.0];
Number y = DistinctCount(x)Number x = DistinctCount(["str1","str1","str3","str4","str4","str6"])}Number x = DistinctCount(@dbfield)Number x = DistinctCount(@formula)Number x = DistinctCount(@dbfield, "group_field")Number x = DistinctCount(@formula, @"group_field")Number x = DistinctCount(@dbfield, @parameter)Note: If a field_variable is assigned to a variable, for example X, the variable X will lose the characteristic of representing a group of values. The following formula will then be treated as incorrect.
Number x = @dbfield;
Number y = DistinctCount(x); // system will prompt you that there is no such kind of function.