PostHog / PostHog/posthog

Feature Request: Experiment metrics need more aggregation types

Open
#34,992 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement experiments/new-engine feature/experiments team/experiments
Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
7h 27m
Merged PRs (30d)
222

Description

Feature request

Is your feature request related to a problem?

In the old experiments UI, trends metrics supported more aggregation types, including SQL expression:

Image

This allowed for more advanced calculations and use cases.

Currently, we support only a subset of those:

Image

Describe the solution you'd like

Bring the current experiment metric aggregation types to parity with the old version, allowing users to keep making calculations on their metrics. A particular use case is calculating on data warehouse values which SQL expression allows.

Describe alternatives you've considered

  • Not calculate as I was able to in the past
  • Change my experiment design

Additional context

From: https://posthoghelp.zendesk.com/agent/tickets/33393 (moved to PostHog: https://us.posthog.com/project/2/support/tickets/36554)

Debug info
Kind: support

Target area: experiments

Report event: http://go/ticketByUUID/1f773e13-466e-49da-94fe-cf7153122150

Session: https://us.posthog.com/project/sTMFPsFhdP1Ssg/replay/0197bffa-9457-7e95-a748-e280e303b10c?t=1760

Exceptions: https://us.posthog.com/project/2/error_tracking?filterGroup=%7B%22type%22%3A%22AND%22%2C%22values%22%3A%5B%7B%22type%22%3A%22AND%22%2C%22values%22%3A%5B%7B%22key%22%3A%22%24session_id%22%2C%22value%22%3A%5B%220197bffa-9457-7e95-a748-e280e303b10c%22%5D%2C%22operator%22%3A%22exact%22%2C%22type%22%3A%22event%22%7D%5D%7D%5D%7D

Location: https://us.posthog.com/project/68136/experiments/shared-metrics/new

Persons-on-events mode for project: person_id_override_properties_on_events

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the experiments shared-metrics/new entry point referenced in the issue and compare its available aggregation types with the old experiments UI shown in the screenshots. Trace the metric calculation path and identify how SQL expression support would reach data warehouse values. The issue names no source files or tests, so locate the relevant UI and experiment metric tests first; done means parity with the old aggregation options.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
analytics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.