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.plugin_measure(*args, plugin_key)
Return a measure computed by a plugin registered by an Atoti Server extension.
- Parameters:
-
args (NestedPluginMeasureArgs) –
The arguments forwarded to the measure plugin.
Supported types include:
-
plugin_key (str) – The key of the measure plugin.
- Return type:
MeasureDefinition
Example
>>> session_config = tt.SessionConfig(extra_jars=[server_extension_jar_path])
>>> session = tt.Session.start(session_config)
>>> df = pd.DataFrame(
... [("Phone", 2), ("Watch", 4), ("Laptop", 1)],
... columns=["Product", "Quantity"],
... )
>>> table = session.read_pandas(
... df,
... keys={"Product"},
... table_name="Example",
... )
>>> cube = session.create_cube(table)
>>> l, m = cube.levels, cube.measures
The Atoti Server extension used provided by server_extension_jar_path contributes a measure plugin with the key "MY_INCREMENT":
>>> with tt.experimental({"plugin_measure"}):
... m["Incremented quantity.SUM"] = tt.plugin_measure(
... m["Quantity.SUM"].name, l["Product"], 2, plugin_key="MY_INCREMENT"
... )
>>> cube.query(
... m["Quantity.SUM"],
... m["Incremented quantity.SUM"],
... levels=[l["Product"]],
... )
Quantity.SUM Incremented quantity.SUM
Product
Laptop 1 3
Phone 2 4
Watch 4 6