> ## 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.square_sum()

### atoti.agg.square\_sum(operand: LevelOrVariableColumnConvertible, /) → MeasureDefinition

### atoti.agg.square\_sum(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 sum of the square of the passed measure across the specified scope.

* **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=["id", "Quantity", "Price", "Other"],
...     data=[
...         ("a1", 100, 12.5, 1),
...         ("a2", 10, 43, 2),
...         ("a3", 1000, 25.9, 2),
...     ],
... )
>>> table = session.read_pandas(
...     df,
...     keys=["id"],
...     table_name="Product",
... )
>>> table.head().sort_index()
    Quantity  Price  Other
id
a1       100   12.5      1
a2        10   43.0      2
a3      1000   25.9      2
>>> cube = session.create_cube(table)
>>> m = cube.measures
>>> m["Other.SQUARE_SUM"] = tt.agg.square_sum(table["Other"])
>>> cube.query(m["Other.SQUARE_SUM"])
  Other.SQUARE_SUM
0                9
```
