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

# distinct()

<span id="atoti.agg.distinct" />

> @overload<br />
> atoti.agg.distinct(<br />
>     *operand*: LevelOrVariableColumnConvertible,<br />
>     /,<br />
> ) → MeasureDefinition

> @overload<br />
> atoti.agg.distinct(<br />
>     *operand*: VariableMeasureConvertible,<br />
>     /,<br />
>     \*,<br />
>     *scope*: [CumulativeScope](./atoti.scope.CumulativeScope#atoti.CumulativeScope) | [SiblingsScope](./atoti.scope.SiblingsScope#atoti.SiblingsScope) | [OriginScope](./atoti.scope.OriginScope#atoti.OriginScope),<br />
> ) → MeasureDefinition

Return an array measure equal to the distinct values of the passed measure across the specified scope.

<Warning>
  This feature is [`experimental`](./atoti.experimental#atoti.experimental), its key is `"agg.distinct"`.
</Warning>

### Parameters

<h4 id="atoti.agg.distinct.operand">
  *operand*
</h4>

The measure or table column to aggregate.

<h4 id="atoti.agg.distinct.scope">
  *scope*
</h4>

The [`aggregation scope`](./atoti.scope#module-atoti.scope).

***

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> df = pd.DataFrame(
...     columns=["ID", "City"],
...     data=[
...         (1, "Paris"),
...         (2, "London"),
...         (3, "New York"),
...         (4, "Paris"),
...     ],
... )
>>> table = session.read_pandas(df, keys={"ID"}, table_name="Example")
>>> cube = session.create_cube(table)
>>> l, m = cube.levels, cube.measures
>>> with tt.experimental({"agg.distinct"}):
...     m["Distinct cities"] = tt.agg.distinct(table["City"])
>>> m["Distinct cities"].formatter = "ARRAY[',']"
>>> cube.query(m["Distinct cities"], levels=[l["City"]], include_totals=True)
                Distinct cities
City
Total     New York,London,Paris
London                   London
New York               New York
Paris                     Paris
```
