atoti.Measure#

final class atoti.Measure#

A measure is a mostly-numeric data value, computed on demand for aggregation purposes.

Example

Copying a measure does not copy its attributes:

>>> table = session.create_table("Example", types={"ID": tt.STRING})
>>> cube = session.create_cube(table)
>>> m = cube.measures
>>> m["Original"] = 1
>>> m["Original"].description = "Test description"
>>> m["Original"].folder = "Test folder"
>>> m["Original"].formatter = "INT[test: #,###]"
>>> m["Original"].visible = False
>>> m["Copy"] = m["Original"]
>>> print(m["Copy"].description)
None
>>> print(m["Copy"].folder)
None
>>> m["Copy"].formatter
'INT[#,###]'
>>> m["Copy"].visible
True

Redefining a measure resets its attributes:

>>> m["Original"] = 2
>>> print(m["Original"].description)
None
>>> print(m["Original"].folder)
None
>>> m["Original"].formatter
'INT[#,###]'
>>> m["Original"].visible
True

See also

Measures to define one.

data_type

Type of the values the measure evaluates to.

description

Description of the measure.

folder

Folder of the measure.

formatter

Formatter of the measure.

isnull

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

name

Name of the measure.

visible

Whether the measure is visible or not.