Issue retrieving hierarchy nodes with power_bi.get_member_properties
on an alternative hierarchy
#866
-
Beta Was this translation helpful? Give feedback.
Answered by
gbryant-dev
May 23, 2023
Replies: 1 comment 3 replies
-
Hi @Sven-Bo, thanks for raising this issue. I will try to provide a fix in the next days. from TM1py.Objects.Dimension import Dimension
from TM1py import TM1Service, ElementAttribute
from TM1py.Objects.Element import Element
from TM1py.Objects.Hierarchy import Hierarchy
tm1_local = {
"address": "localhost",
"port": 8010,
"user": "admin",
"password": "apple",
"ssl": True
}
tm1 = TM1Service(**tm1_local)
hierarchy1 = Hierarchy(
name="TM1py Region",
dimension_name="TM1py Region",
elements=[Element("Europe", "Consolidated"), Element("CH", "Numeric"), Element("UK", "Numeric")],
element_attributes=[ElementAttribute("Currency", "String")],
edges={("Europe", "CH"): 1, ("Europe", "UK"): 1})
hierarchy2 = Hierarchy(
name="TM1py City",
dimension_name="TM1py Region",
elements=[Element("Germany", "Consolidated"), Element("Munich", "Numeric"), Element("Munich", "Numeric")],
edges={("Germany", "Munich"): 1, ("Germany", "Munich"): 1})
dimension = Dimension(name="TM1py Region", hierarchies=[hierarchy1, hierarchy2])
tm1.dimensions.update_or_create(dimension)
df = tm1.power_bi.get_member_properties(dimension_name="TM1py Region", hierarchy_name="TM1py City")
print(df) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@FranciscoLeiteAlves Not sure how the problem is identical here as you're getting an error. However, from the error message, it looks like you're not using a sufficient TM1 version as
get_member_properties
ultimately calls theExecuteMDXSetExpression
action in the TM1 REST API which requires TM1 version 11.1.0 or PA 2.0.3.