Describe what did you try to do with TM1py
I am writing a script to get the parent-child relationship and also a flattened hierarchy which will be exported as a pandas dataframe. I have seen the _get_elementsdataframe function, but don't find it suitable to get a parent-child relationship out of it. What I want is a simple data frame of 4 columns - Parent ID, Parent Attribute, Child ID, and Child Attribute. Is there a pre-existing function that already does that in TM1Py? If not what can be an efficient workaround?
For the flattened hierarchy as well is there a way to get all levels with their single attribute, something like this -
Level 0, Attribute Level 0, Level 1, Attribute Level 1 etc
You could use the get_elements_dataframe function as a starting point and retrieve the parent attribute values in a separate post-processing step.
In terms of lines of code, this should be the easiest solution.
Describe what did you try to do with TM1py I am writing a script to get the parent-child relationship and also a flattened hierarchy which will be exported as a pandas dataframe. I have seen the _get_elementsdataframe function, but don't find it suitable to get a parent-child relationship out of it. What I want is a simple data frame of 4 columns - Parent ID, Parent Attribute, Child ID, and Child Attribute. Is there a pre-existing function that already does that in TM1Py? If not what can be an efficient workaround?
For the flattened hierarchy as well is there a way to get all levels with their single attribute, something like this - Level 0, Attribute Level 0, Level 1, Attribute Level 1 etc