> ## 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.

# atoti.agg.single_value()

### atoti.agg.single\_value(operand: [Column](./atoti.column#atoti.Column), /) → MeasureDefinition

### atoti.agg.single\_value(operand: VariableMeasureConvertible, /, \*, scope: [CumulativeScope](./atoti.scope.cumulative_scope#atoti.CumulativeScope) | [SiblingsScope](./atoti.scope.siblings_scope#atoti.SiblingsScope) | [OriginScope](./atoti.scope.origin_scope#atoti.OriginScope)) → MeasureDefinition

Return a measure equal to the value aggregation of the operand across the specified scope.

If the value is the same for all members of the level the operand is being aggregated on, it will be propagated to the next level.

`None` values are ignored: they will not prevent the propagation.

* **Parameters:**
  * **operand** – The measure or table column to aggregate.
  * **scope** – The [`aggregation scope`](./atoti.scope#module-atoti.scope).

### Example

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> df = pd.DataFrame(
...     columns=["Continent", "Country", "City", "Price"],
...     data=[
...         ("Europe", "France", "Paris", 200.0),
...         ("Europe", "France", "Lyon", 200.0),
...         ("Europe", "UK", "London", 200.0),
...         ("Europe", "UK", "Manchester", 150.0),
...         ("Europe", "France", "Bordeaux", None),
...     ],
... )
>>> table = session.read_pandas(df, keys={"Continent", "Country", "City"}, table_name="Example")
>>> cube = session.create_cube(table)
>>> h, l, m = cube.hierarchies, cube.levels, cube.measures
>>> h["Geography"] = [table["Continent"], table["Country"], table["City"]]
>>> for name in h["Geography"]:
...     del h[name]
>>> m["Price.VALUE"] = tt.agg.single_value(table["Price"])
>>> cube.query(
...     m["Price.VALUE"],
...     levels=[l["City"]],
...     include_empty_rows=True,
...     include_totals=True,
... )
                             Price.VALUE
Continent Country City
Total
Europe
          France                  200.00
                  Bordeaux
                  Lyon            200.00
                  Paris           200.00
          UK
                  London          200.00
                  Manchester      150.00
```

* The City level is the most granular level so the members have the same value as in the input dataframe (including `None` for Bordeaux).
* All the cities in France have the same price or `None` so the value is propagated to the Country level.
  The values in the UK cities are different so Price.VALUE is `None`.
* The cities in Europe have different values so the Price.VALUE is `None` at the Continent level.
