<br />

## Usage

```
view: view_name {
  measure: field_name {
    approximate: yes 
  }
}
```

|---|---|
| Hierarchy [View File](https://docs.cloud.google.com/looker/docs/2616/reference/param-view.md.txt) [`view`](https://docs.cloud.google.com/looker/docs/2616/reference/param-view-view.md.txt) [Field Type](https://docs.cloud.google.com/looker/docs/2616/reference/param-field.md.txt) `approximate` | Possible Field Types Measure <br /> Accepts A Boolean (yes or no) <br /> |

## Definition

> See the [Dialect support for `approximate`](https://docs.cloud.google.com/looker/docs/2616/reference/param-field-approximate.md.txt#dialect_support) section on this page for the list of dialects that support `approximate`.

The `approximate` parameter lets you use approximate counting with measures of `type: count` and `type: count_distinct`. With large datasets, approximate counts can be *much* faster than exact counts and are typically within a few percent of the actual value. Check your SQL dialect's documentation to understand the speed and accuracy tradeoffs of this method.

    measure: apx_unique_count {
      type: count_distinct
      approximate: yes   # default value is no
      sql: ${id} ;;
    }

Turning on `approximate` with a measure of `type: count` might seem unnecessary, because the approximate counting feature applies only to distinct counts. However, there are some situations when Looker automatically turns measures of `type: count` into a distinct count of a primary key to provide accurate results for joined views. In those situations, approximate counting may be useful.


## Dialect support for `approximate`

The ability to use `approximate` depends on the database dialect that your Looker connection is using. In the latest version of Looker, the following dialects support `approximate`:

| Dialect | Supported? |
|---|---|
| Actian Avalanche | No |
| Amazon Athena | Yes |
| Amazon Aurora MySQL | No |
| Amazon Redshift | Yes |
| Amazon Redshift 2.1+ | Yes |
| Amazon Redshift Serverless 2.1+ | Yes |
| Apache Druid | No |
| Apache Druid 0.13.x - 0.17.x | No |
| Apache Druid 0.18+ | No |
| Apache Hive 2.3+ | No |
| Apache Hive 3.1.2+ | No |
| Apache Spark 3+ | No |
| ClickHouse | No |
| Cloudera Impala 3.1+ | Yes |
| Cloudera Impala 3.1+ with Native Driver | Yes |
| Cloudera Impala with Native Driver | Yes |
| DataVirtuality | No |
| Databricks | No |
| Denodo 7 | No |
| Denodo 8 \& 9 | No |
| Dremio | No |
| Dremio 11+ | No |
| Exasol | No |
| Google BigQuery Legacy SQL | Yes |
| Google BigQuery Standard SQL | Yes |
| Google Cloud AlloyDB for PostgreSQL | No |
| Google Cloud PostgreSQL | No |
| Google Cloud SQL | No |
| Google Spanner | No |
| Greenplum | No |
| HyperSQL | No |
| IBM Netezza | No |
| MariaDB | No |
| Microsoft Azure PostgreSQL | No |
| Microsoft Azure SQL Database | No |
| Microsoft Azure Synapse Analytics | No |
| Microsoft SQL Server 2008+ | No |
| Microsoft SQL Server 2012+ | No |
| Microsoft SQL Server 2016 | No |
| Microsoft SQL Server 2017+ | No |
| MongoBI | No |
| MongoSQL | No |
| MySQL | No |
| MySQL 8.0.12+ | No |
| Oracle | No |
| Oracle ADWC | No |
| PostgreSQL 9.5+ | No |
| PostgreSQL pre-9.5 | No |
| PrestoDB | Yes |
| PrestoSQL | Yes |
| SAP HANA | No |
| SAP HANA 2+ | No |
| SingleStore | No |
| SingleStore 7+ | No |
| Snowflake | Yes |
| Teradata | No |
| Trino | Yes |
| Vector | No |
| Vertica | No |