Feature Request
Currently MDXView.construct_body() only serializes @odata.type, Name, and MDX. The TM1 REST API accepts additional properties on MDX views, most notably Meta, which enables powerful PAW/Planning Analytics Workspace features such as:
Meta.Aliases — display members using a specific alias instead of the element name
Meta.ContextSets — define subsets or expressions for context (title/WHERE) dimensions
Meta.ExpandAboves — control expand-above behaviour per dimension
Without access to these properties from TM1py, these settings can only be configured interactively inside PAW and cannot be managed programmatically or via automation pipelines.
Proposed Change
Add an optional properties: dict parameter to MDXView.__init__() and include it in construct_body():
def __init__(self, cube_name: str, view_name: str, MDX: str, properties: Optional[Dict] = None):
...
self._properties = properties or {}
def construct_body(self) -> str:
mdx_view_as_dict = collections.OrderedDict()
mdx_view_as_dict["@odata.type"] = "ibm.tm1.api.v1.MDXView"
mdx_view_as_dict["Name"] = self._name
mdx_view_as_dict["MDX"] = self._mdx
mdx_view_as_dict.update(self._properties)
return json.dumps(mdx_view_as_dict, ensure_ascii=False)
Example Usage
view = MDXView(
cube_name="EIS_CUBE",
view_name="Dummy_View",
MDX="SELECT ... FROM [EIS_CUBE] WHERE (...)",
properties={
"IsAutocalculate": False,
"Meta": {
"Aliases": {"[dim_One].[dim_One]": "Short_DE"},
"ContextSets": {
"[dim_Four].[dim_Four]": {"IsPublic": True, "SubsetName": "Default"},
"[dim_Three].[dim_Three]": {"Expression": "{[dim_Three].[dim_Three].MEMBERS}"}
},
"ExpandAboves": {
"[dim_Four].[dim_Four]": False,
"[dim_Two].[dim_Two]": False
}
}
}
)
Feature Request
Currently
MDXView.construct_body()only serializes@odata.type,Name, andMDX. The TM1 REST API accepts additional properties on MDX views, most notablyMeta, which enables powerful PAW/Planning Analytics Workspace features such as:Meta.Aliases— display members using a specific alias instead of the element nameMeta.ContextSets— define subsets or expressions for context (title/WHERE) dimensionsMeta.ExpandAboves— control expand-above behaviour per dimensionWithout access to these properties from TM1py, these settings can only be configured interactively inside PAW and cannot be managed programmatically or via automation pipelines.
Proposed Change
Add an optional
properties: dictparameter toMDXView.__init__()and include it inconstruct_body():Example Usage