atoti_query.query_measure module#

class atoti_query.QueryMeasure#
property description: str | None#

Description of the measure.

property folder: str | None#

Folder of the measure.

property formatter: str | None#

Formatter of the measure.

isnull()#

Return a condition evaluating to True if the measure evalutes to None and False otherwise.

Use ~measure.isnull() for the opposite behavior.

Example

>>> df = pd.DataFrame(
...     columns=["Country", "City", "Price"],
...     data=[
...         ("France", "Paris", 200.0),
...         ("Germany", "Berlin", None),
...     ],
... )
>>> table = session.read_pandas(df, table_name="isnull example")
>>> cube = session.create_cube(table)
>>> l, m = cube.levels, cube.measures
>>> m["Price.isnull"] = m["Price.SUM"].isnull()
>>> m["Price.notnull"] = ~m["Price.SUM"].isnull()
>>> cube.query(
...     m["Price.isnull"],
...     m["Price.notnull"],
...     levels=[l["Country"]],
... )
        Price.isnull Price.notnull
Country
France         False          True
Germany         True         False
Return type:

Condition[MeasureIdentifier, Literal[‘eq’], None, None]

property name: str#

Name of the measure.

property visible: bool#

Whether the measure is visible or not.