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

Cumulative count/sum grouping should ORDER BY first and PARTITION BY all other breakouts #42003

Closed
maxzheng opened this issue Apr 29, 2024 · 1 comment · Fixed by #42131
Closed
Assignees
Labels
.Backend Priority:P2 Average run of the mill bug Querying/Processor .Team/QueryProcessor :hammer_and_wrench: Type:Bug Product defects

Comments

@maxzheng
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Currently, to do cumulative count with a breakout, it needs to be grouped by the breakout first. E.g. To do cumulative count of accounts over time by plan, you need to group by Plan Name first, followed by Created At. That is not intuitive for users as users would intuitively group by Created At first and then followed by the Plan Name -- the reverse order.

Another way of thinking about this is, if a user starts with total cumulative count for all plans, and then wants to break that by plan, currently it is not as easy as adding an additional group of Plan Name but it also requires the user to reorder the grouping. Without reordering, the counts are wrong. If the user adds the grouping in the Summarize side bar, it's not possible to reorder there without removing the initial group first.

Describe the solution you'd like

Ideally, it should work regardless of the grouping order, however if we have to pick one, then the reverse order from current implementation would be more intuitive, so Created At first followed by Plan Name. With that setup, it is easy to add the 2nd grouping when starting with total / one grouping only or switch to another 2nd grouping.

Describe alternatives you've considered

Existing behavior and remember to have the groups in the right order, otherwise the counts will be wrong.

How important is this feature to you?

It would make the cumulative count feature easier to use with breakouts.

@camsaul
Copy link
Member

camsaul commented May 1, 2024

See also original issue #2862 and Slack thread https://metaboat.slack.com/archives/C05MPF0TM3L/p1714084449574689

@camsaul camsaul added Type:Bug Product defects Priority:P2 Average run of the mill bug and removed Type:New Feature labels May 1, 2024
@camsaul camsaul changed the title Cumulative count grouping could be more intuitive Cumulative count/sum grouping should ORDER BY first and PARTITION BY all other breakouts May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.Backend Priority:P2 Average run of the mill bug Querying/Processor .Team/QueryProcessor :hammer_and_wrench: Type:Bug Product defects
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants