Skip to content

Commit

Permalink
fix(trends): only filter breakdown values when needed (#21219)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra authored Mar 28, 2024
1 parent 703a4ec commit 01ea124
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 34 deletions.
4 changes: 4 additions & 0 deletions posthog/hogql_queries/insights/trends/breakdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ def events_where_filter(self) -> ast.Expr | None:
right=ast.Constant(value=self.query.breakdownFilter.breakdown),
)

# No need to filter if we're showing the "other" bucket, as we need to look at all events anyway.
if self.query.breakdownFilter is not None and not self.query.breakdownFilter.breakdown_hide_other_aggregation:
return ast.Constant(value=True)

if (
self.query.breakdownFilter is not None
and self.query.breakdownFilter.breakdown is not None
Expand Down
Loading

0 comments on commit 01ea124

Please sign in to comment.