Allow Dimension Properties Per Axis
Allows dimension properties per axis (18, 34 ). Sample:
python
from TM1py import TM1Service
from mdxpy import MdxBuilder, MdxHierarchySet, Member, DimensionProperty
with TM1Service(address='localhost', port=12354, ssl=True, user="admin", password="apple") as tm1:
query = MdxBuilder.from_cube("c1")
query.add_hierarchy_set_to_row_axis(MdxHierarchySet.all_leaves("d1", "d1"))
query.add_properties_to_row_axis(DimensionProperty("d1", "d1", "Description"))
query.rows_non_empty()
query.add_hierarchy_set_to_column_axis(MdxHierarchySet.member(Member.of("d2", "e1")))
query.columns_non_empty()
print(query.to_mdx())
df = tm1.cells.execute_mdx_dataframe(mdx=query.to_mdx(), include_attributes=True)
print(df.head(4).to_markdown())
> Output
SELECT
NON EMPTY {[d2].[d2].[e1]} DIMENSION PROPERTIES MEMBER_NAME ON 0,
NON EMPTY {TM1FILTERBYLEVEL({TM1SUBSETALL([d1].[d1])},0)} DIMENSION PROPERTIES [d1].[d1].[description] ON 1
FROM [c1]
| | d1 | Description | d2 | Value |
|---:|:-----|:--------------|:-----|--------:|
| 0 | e1 | a1 | e1 | 1 |
| 1 | e2 | a2 | e1 | 2 |
| 2 | e3 | a3 | e1 | 3 |
| 3 | e4 | a4 | e1 | 10 |