atoti_query.query_measure module#

class atoti_query.QueryMeasure#
property description: Optional[str]#

Description of the measure.

property folder: Optional[str]#

Folder of the measure.

property formatter: Optional[str]#

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[MeasureCoordinates, Literal[‘eq’], None, None]

property name: str#

Name of the measure.

property visible: bool#

Whether the measure is visible or not.