CSV cellset rendering assumes static number of attributes. If number of attributes differs between tuples it misaligns data.
Thanks for raising this issue.
Currently, we don't support MDX queries with include_attributes=True but without explicit PROPERTIES statements in the MDX.
If you explicitly specify the attributes that you want to retrieve in the MDX, it should not fail.
from TM1py import TM1Service
with TM1Service(address="", port=12354, user="admin", password="apple", ssl=True) as tm1:
mdx = """
SELECT
{Tm1SubsetAll([d1])} PROPERTIES [d1].[Attribute Something] ON 0,
{Tm1SubsetAll([d2])} PROPERTIES [d2].[Number] ON 1
FROM [c1]
"""
data = tm1.cells.execute_mdx_dataframe(mdx, include_attributes=True)
print(data)
If you don't want to retrieve attributes from a dimension you can write this.
from TM1py import TM1Service
with TM1Service(address="", port=12354, user="admin", password="apple", ssl=True) as tm1:
mdx = """
SELECT
{Tm1SubsetAll([d1])} PROPERTIES [d1].[Attribute Something] ON 0,
{Tm1SubsetAll([d2])} PROPERTIES MEMBER_NAME ON 1
FROM [c1]
"""
data = tm1.cells.execute_mdx_dataframe(mdx, include_attributes=True)
print(data)
Can you give this a try?
Please feel free to open a PR if you would like to enhance the existing logic.
Thanks! Is it ok to keep this open so I can refer to it when I make a PR?
Thanks! Is it ok to keep this open so I can refer to it when I make a PR?
absolutely!
Most helpful comment
Thanks! Is it ok to keep this open so I can refer to it when I make a PR?