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

getReport methods do not accept requests without a dimension #90

Closed
loldenburg opened this issue Mar 15, 2023 · 6 comments
Closed

getReport methods do not accept requests without a dimension #90

loldenburg opened this issue Mar 15, 2023 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@loldenburg
Copy link
Contributor

It seems to not be possible to get simple summary metrics via the wrapper easily.
This report
image
where the "dimension" is the "All Visits" segment gets me this JSON:

{
            "rsid": "REPORTSUITE",
            "globalFilters": [
                {
                    "type": "dateRange",
                    "dateRange": "2023-03-09T00:00:00.000/2023-03-16T00:00:00.000",
                    "dateRangeId": "last7Days"
                }
            ],
            "metricContainer": {
                "metrics": [
                    {
                        "columnId": "metrics/event8:::0",
                        "id": "metrics/event8",
                        "filters": [
                            "STATIC_ROW_COMPONENT_1"
                        ]
                    }
                ],
                "metricFilters": [
                    {
                        "id": "STATIC_ROW_COMPONENT_1",
                        "type": "segment",
                        "segmentId": "All_Visits"
                    }
                ]
            },
            "settings": {
                "countRepeatInstances": True,
                "includeAnnotations": False
            },
            "statistics": {
                "functions": [
                    "col-max",
                    "col-min"
                ]
            },
            "capacityMetadata": {
                "associations": [
                    {
                        "name": "applicationName",
                        "value": "Analysis Workspace UI"
                    }
                ]
            }
        }

But the function throws an error because the _dataDescriptor always expects a "dimension".
Same if the "dimension" is a date range, e.g.:
image

I can work around this, but what is the most efficient way to get simply the total number of [[metric X]] for a certain date range (without any dimensions)?

@cyaris
Copy link

cyaris commented Apr 25, 2023

Would love this to be fixed if possible. No issue here for getReport2 but that method has a bug for metrics/pageviews.

@pitchmuc pitchmuc self-assigned this Apr 26, 2023
@pitchmuc pitchmuc added the enhancement New feature or request label Apr 26, 2023
@pitchmuc
Copy link
Owner

Hello @loldenburg
Sorry for the delay on this.
You should use the getReport2 method, I am trying to adjust the getReport method for this but it is not well built so pretty difficult.
getReport2 supports this use-case.

@pitchmuc
Copy link
Owner

let me know if it works now.
(Also, I would encourage you to start using getReport2 more often.

@pitchmuc
Copy link
Owner

I just did a release that will also apply the resolveColumn parameter for staticRow report for getReport2. So you have a better dataframe ouput.
version 0.3.3.post2 (or 0.3.3-2)

@loldenburg
Copy link
Contributor Author

loldenburg commented Apr 26, 2023 via email

@pitchmuc
Copy link
Owner

My test
image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants