<br />

## Usage

```
view: view_name {
  measure: field_name {
    approximate_threshold: 100000
  }
}
```

|---|---|
| Hierarchy [View File](https://docs.cloud.google.com/looker/docs/2616/reference/param-view) [`view`](https://docs.cloud.google.com/looker/docs/2616/reference/param-view-view) [Field Type](https://docs.cloud.google.com/looker/docs/2616/reference/param-field) `approximate_threshold` | Possible Field Types Measure <br /> Accepts An integer <br /> |

## Definition

Google BigQuery Legacy SQL calculates an exact `count_distinct` if there are fewer than 1,000 distinct values, but performs an approximation for larger numbers of distinct values. The approximate count is faster, but typically has an error of a few percent.

If you want BigQuery Legacy SQL to calculate an exact `count_distinct` for more than 1,000 distinct values, you can set that amount with the `approximate_threshold` parameter.

## Examples

Return an exact `count_distinct` for up to 100,000 distinct values:

    measure: unique_count {
      type: count_distinct
      approximate_threshold: 100000   # default value is 1000
      sql: ${id} ;;
    }