> ## Documentation Index
> Fetch the complete documentation index at: https://docs.narrative.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Conflicting Distinct Count Methods

> approx_count_distinct and count_distinct cannot both be enabled in the same stat set

## Error message

```
{context}: approx_count_distinct and count_distinct cannot both be enabled
```

Example: `defaults: approx_count_distinct and count_distinct cannot both be enabled`

## When this error occurs

`approx_count_distinct` uses HyperLogLog for fast approximate cardinality. `count_distinct` computes the exact value. Enabling both on the same scope is redundant and indicates a configuration mistake, so the server rejects it.

This validation applies at every level: defaults, namespace scope, field overrides, and nested nodes.

## Example: request that triggers this error

```json theme={null}
{
  "defaults": {
    "enabled_stats": [
      "value_count",
      "approx_count_distinct",
      "count_distinct"
    ]
  },
  "refresh": { "trigger": "manual" }
}
```

## How to fix

Choose one of the two:

* **`approx_count_distinct`** — faster, suitable for large datasets where an estimate is acceptable
* **`count_distinct`** — exact, more expensive to compute

```json theme={null}
{
  "defaults": {
    "enabled_stats": ["value_count", "approx_count_distinct"]
  },
  "refresh": { "trigger": "manual" }
}
```
