-
Notifications
You must be signed in to change notification settings - Fork 118
Allow multi axes queries in execute_mdx function
#777
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
Hello Marius,
For me in a test cube, PAW sends axes 2, 3, 4 to the bench and only shows 0
and 1.
Is this expected behaviour or is this MDX view only used for getting values
instead of an object for the users in the interfaces ?
Best regards,
Wim
…------
Best regards / Beste groeten,
Wim Gielis
MS Excel MVP 2011-2014
https://www.wimgielis.com <http://www.wimgielis.be>
Op ma 8 aug. 2022 om 15:37 schreef Marius Wirtz ***@***.***>:
The new change allows this:
from TM1py import TM1Service
with TM1Service(base_url="https://localhost:12354", user="admin", password="apple") as tm1:
mdx = """ SELECT NON EMPTY Tm1FilterByLevel({TM1SubsetAll([d1])},0) on 0, NON EMPTY Tm1FilterByLevel({TM1SubsetAll([d2])},0) on 1, NON EMPTY Tm1FilterByLevel({TM1SubsetAll([d3])},0) on 2, NON EMPTY Tm1FilterByLevel({TM1SubsetAll([d4])},0) on 3, NON EMPTY Tm1FilterByLevel({TM1SubsetAll([d5])},0) on 4 FROM [c5] """
cells = tm1.cells.execute_mdx(mdx, element_unique_names=False, skip_cell_properties=True)
for elements, value in cells.items():
print(elements, value)
('e1', 'e1', 'e01', 'e01', 'e01') 4
('e1', 'e1', 'e01', 'e02', 'e01') 1
('e1', 'e1', 'e01', 'e01', 'e02') 2
('e1', 'e1', 'e01', 'e02', 'e02') 3
------------------------------
You can view, comment on, or merge this pull request online at:
#777
Commit Summary
- e43d64f
<e43d64f>
Allow multi axes queries in `execute_mdx` function
File Changes
(2 files <https://github.com/cubewise-code/tm1py/pull/777/files>)
- *M* TM1py/Utils/Utils.py
<https://github.com/cubewise-code/tm1py/pull/777/files#diff-dfa6efa267891cf338ac4ae2fb7d41b941f6ecef55b265005ff460b33c9e8f9d>
(42)
- *M* Tests/CellService_test.py
<https://github.com/cubewise-code/tm1py/pull/777/files#diff-d044783f3dd2a3bc2510c242076847e316dd0ce57d3724cc09870fcca88f5e2d>
(59)
Patch Links:
- https://github.com/cubewise-code/tm1py/pull/777.patch
- https://github.com/cubewise-code/tm1py/pull/777.diff
—
Reply to this email directly, view it on GitHub
<#777>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEDHULP2TZPVXPPSDCAFVTTVYEEQBANCNFSM555FIAFA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Collaborator
|
I'd say PAW doesn't know what to do with additional axis. I'm not sure there is any Standard tbh.
I would like PAW to reflect multiple axis with something like tabs or pages.
|
Collaborator
Author
|
@wimgielis I don't know what PAW does in detail, but the API responses are consistent with the MDX queries. We noticed that when using asymmetric tuples in the selections, multi-axes queries perform much better than queries with stacked selections on 0 or 1. |
Collaborator
|
@MariusWirtz do you have an example query that you can share? |
Collaborator
Author
|
@rclapp here is a sample: The above executes faster than the below in my tests. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The new change allows this: