MicroStrategy / mstrio-py

Python integration for MicroStrategy
Apache License 2.0
90 stars 60 forks source link

Page By Elements as Row Element #85

Closed reyemb closed 2 years ago

reyemb commented 2 years ago

If there is a page-by-element in the report than the report result will only show the results for that certain page-by or for that page-by-combination. In the userinterface there is the possibility to drag and drop the page by element into the table row so that the page-by-element becomes an attribute. Can this be done with the rest-api / mstrio-py as well?

For example I have a simple report with the date as page by element and one metric called absatz. If I run the report I get the following result:

Page-By-View

If I use the report.to_dataframe() method I will get an dataframe with only one line. In the userinterface I can drag and drop the element into the results like:

Page-By-To-Row

After that I do have the full report with all the data in it.

Page-By-In-Row

I know that I can change the page-by-element via the rest-api and fetch the data again, but in this case I would have to do it 324 times just to receive one line each time. Can Page-By-Elements inserted into the results and the results fetched via the rest-api / mstrio-py?

At the moment I create 2 reports one with page-by-elements and one with the page-by-elements as attributes.

urszulajaczewska commented 2 years ago

Hi @reyemb, we'll look into it and I'll get back to you with a feedback as soon as I have more info.

p-kowal commented 2 years ago

Hey @reyemb! Thanks for showing us the issue. Our Product Management has been notified by me and will make a future roadmap decision about this. For now, the workaround that I think will work is to use the cube as data source and then perform the report-like manipulations there. BTW: please help me understand, do you often use Report as your data source? Isn't cube better in a way, that it is raw data?

reyemb commented 2 years ago

Hey @p-kowal thank you for fast reply.

At the moment I only use reports as my data source. I don't own the privilege to create cubes, but I do own the privilege to create reports. So I create reports with a prompts to specify the data I need or apply certain filters. Therefor I have extended mstrio-py with some functions to answer all kind of prompts. After the prompts are answered I ll fetch the report result with the .to_dataframe - function.

I have taken a look at cubes. Yes it would be a far better solution. Thank you for pointing this out.