Description | The |
Syntax | COUNT_DISTINCT( |
Output | integer |
Variables
arg
: the field to be counted.
Example
COUNT_DISTINCT(Value
) Over (Partition by Group
)
ID | Group | Value | COUNT_DISTINCT |
1 | A | 10 | 2 |
2 | A | 20 | 2 |
3 | A | 10 | 2 |
4 | A |
| 0 |
5 | B | 30 | 1 |
Counts the number of unique values in a specified field within a range or partition
Description | The |
Syntax | COUNT_DISTINCT( |
Output | integer |
arg
: the field to be counted.
COUNT_DISTINCT(Value
) Over (Partition by Group
)
ID | Group | Value | COUNT_DISTINCT |
1 | A | 10 | 2 |
2 | A | 20 | 2 |
3 | A | 10 | 2 |
4 | A |
| 0 |
5 | B | 30 | 1 |