@overload
Session.query_mdx(
mdx: str,
/,
*,
context: Mapping[str, bool | int | float | str] =frozendict({}),
explain: Literal[False] =False,
keep_totals: bool =False,
mode: Literal[‘pretty’] ='pretty',
) → MdxQueryResult
@overload
Session.query_mdx(
mdx: str,
/,
*,
context: Mapping[str, bool | int | float | str] =frozendict({}),
explain: Literal[False] =False,
keep_totals: bool =False,
mode: Literal[‘pretty’, ‘raw’] ='pretty',
) → DataFrame
@overloadExecute an MDX query. In JupyterLab with
Session.query_mdx(
mdx: str,
/,
*,
context: Mapping[str, bool | int | float | str] =frozendict({}),
explain: Literal[True],
keep_totals: bool =False,
mode: Literal[‘pretty’, ‘raw’] ='pretty',
) → object
atoti-jupyterlab installed, query results can be converted to interactive widgets with the Convert to Widget Below action available in the command palette or by right clicking on the representation of the returned Dataframe.
Parameters
mdx
The MDXSELECT query to execute.
Regardless of the axes on which levels and measures appear in the MDX, the returned DataFrame will have all levels on rows and measures on columns.
context
Context values to use when executing the query. Seeshared_context for some of the available context values.
explain
WhenTrue, execute the query but, instead of returning its result, return an explanation of how it was executed containing a summary, global timings, and the query plan and all its retrievals.
keep_totals
Whether the resulting DataFrame should contain, if they are present in the query result, the grand total and subtotals. Totals can be useful but they make the DataFrame harder to work with since its index will have some empty values.mode
The query mode."pretty"is best for queries returning small results."raw"is best for benchmarks or large exports:- A faster and more efficient endpoint reducing the data transfer from Java to Python will be used.
- The Convert to Widget Below action provided by
atoti-jupyterlabwill not be available.
See also:
atoti.Cube.query()