Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support hierarchies in get_elements_dataframe #876

Merged
merged 1 commit into from
Mar 10, 2023

Conversation

MariusWirtz
Copy link
Collaborator

Fixes #868

@MariusWirtz
Copy link
Collaborator Author

@Sven-Bo this should resolve the issue #868
please upgrade to this branch and verify that it resolves the issue

pip uninstall tm1py
pip install https://github.com/cubewise-code/tm1py/archive/refs/heads/master.zip

On a side note, the tm1.power_bi.get_member_properties is actually just a pointer to the tm1.elements.get_elements_dataframe function. Just like the tm1.power_bi.execute_mdx points to the tm1.cells.execute_mdx_dataframe_shaped.

Lots of users get confused about the PowerBiService within TM1py. While it actually just delegates to other functions, within TM1py, I wonder if we might deprecate it in a future version and ask people to call the underlying functions directly.

df = tm1.elements.get_elements_dataframe(
    dimension_name="TM1py Region",
    hierarchy_name="TM1py City",
    skip_weights=False)
TM1py Region Type Currency level000_Weight level000
0 Munich Numeric 1 Germany

@Sven-Bo
Copy link

Sven-Bo commented Mar 9, 2023

@MariusWirtz , thank you so much for the prompt fix! Upgrading to the latest branch did the trick, and everything is now working perfectly.

I also appreciate the heads up about the PowerBIService simply being a pointer to other methods. I had actually noticed this myself while I was digging around, trying to understand what was happening behind the scenes.

Regarding your suggestion to deprecate the PowerBiService, I personally don't find it confusing, but I wouldn't mind calling the underlying functions either. Whatever makes things simpler and more efficient.

Once again, thanks for your help in resolving the issue.

@MariusWirtz
Copy link
Collaborator Author

Thanks!

@MariusWirtz MariusWirtz merged commit 7b3d2c3 into master Mar 10, 2023
@MariusWirtz MariusWirtz deleted the issue/get-elements-dataframe-with-hierarchies branch October 15, 2024 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Retrieving hierarchy nodes with power_bi.get_member_properties on alternative hierarchy
3 participants