posthog icon indicating copy to clipboard operation
posthog copied to clipboard

Breakdown by cohort effectively filters rather than breaking down

Open marcushyett-ph opened this issue 4 years ago • 15 comments

Bug description

If I break down by a cohort I see a filtered version of the funnel rather than one that breaks down incohort vs outside of cohort

https://app.posthog.com/insights?insight=FUNNELS&properties=%5B%5D&filter_test_accounts=true&events=%5B%7B%22id%22%3A%22first%20team%20event%20ingested%22%2C%22name%22%3A%22first%20team%20event%20ingested%22%2C%22type%22%3A%22events%22%2C%22order%22%3A1%7D%5D&actions=%5B%7B%22id%22%3A%222674%22%2C%22name%22%3A%22User%20Signed%20Up%20(Comprehensive)%22%2C%22type%22%3A%22actions%22%2C%22order%22%3A0%7D%2C%7B%22id%22%3A%224912%22%2C%22name%22%3A%22Discovered%20Learning%22%2C%22type%22%3A%22actions%22%2C%22order%22%3A2%7D%5D&funnel_viz_type=steps&display=FunnelViz&interval=day&breakdown=%5B320%5D&breakdown_type=cohort&new_entity=%5B%5D&date_from=-90d

Expected behavior

I would expect to see the funnel broken down by In Cohort X: True, False

But I see it broken down by In Cohort X: True (only)

Which is effectively the same as the filter functionality

How to reproduce

  1. https://app.posthog.com/insights?insight=FUNNELS&properties=%5B%5D&filter_test_accounts=true&events=%5B%7B%22id%22%3A%22first%20team%20event%20ingested%22%2C%22name%22%3A%22first%20team%20event%20ingested%22%2C%22type%22%3A%22events%22%2C%22order%22%3A1%7D%5D&actions=%5B%7B%22id%22%3A%222674%22%2C%22name%22%3A%22User%20Signed%20Up%20(Comprehensive)%22%2C%22type%22%3A%22actions%22%2C%22order%22%3A0%7D%2C%7B%22id%22%3A%224912%22%2C%22name%22%3A%22Discovered%20Learning%22%2C%22type%22%3A%22actions%22%2C%22order%22%3A2%7D%5D&funnel_viz_type=steps&display=FunnelViz&interval=day&breakdown=%5B320%5D&breakdown_type=cohort&new_entity=%5B%5D&date_from=-90d

Environment

  • [x] PostHog Cloud
  • [ ] self-hosted PostHog, version/commit: please provide

marcushyett-ph avatar Aug 12 '21 10:08 marcushyett-ph

cc @EDsCODE you were making changes here recently?

macobo avatar Aug 12 '21 12:08 macobo

Makes sense! Just FYI, not a new bug, this is how it has "always" worked.

neilkakkar avatar Aug 12 '21 12:08 neilkakkar

Actually, maybe we want to keep this only in filters, and allow multiple cohorts there? (like in https://github.com/PostHog/posthog/issues/5566 ) - thus removing the option of cohorts from breakdowns.

Is there a use-case for analysing users not in a specific cohort - as a breakdown?

neilkakkar avatar Aug 12 '21 13:08 neilkakkar

I guess the key use-case I'm trying to solve for is...

I want to know if people who've viewed our tutorials have a better conversion rate than people who haven't viewed our tutorials...

I'm not sure adding multiple cohorts is an intuitive user experience to solve for this problem. I want to know what's special about this cohort vs the baseline - but doesn't feel intuitive to need to add the baseline myself.

marcushyett-ph avatar Aug 12 '21 13:08 marcushyett-ph

Ooh, that makes a lot of sense.

In the same vein, breakdown on multiple cohorts (A, B, C), should then give 4 buckets: A, B, C, or neither?

neilkakkar avatar Aug 12 '21 13:08 neilkakkar

Yep - I think so.

marcushyett-ph avatar Aug 12 '21 13:08 marcushyett-ph

That doesn't quite work since user can belong to all 3 of the listed cohorts - the numbers wouldn't match up even after adding a Other category.

macobo avatar Aug 12 '21 14:08 macobo

Ah - fair point! So We can only visualize A vs !A? or B vs !B?

marcushyett-ph avatar Aug 13 '21 09:08 marcushyett-ph

Kind of.

I honestly think this (filtering) is the correct behavior if selecting multiple works since it's consistent with behavior in trends. Not to say the UX around choosing multiple cohorts can't be improved (it's quite annoying).

cc @clarkus

macobo avatar Aug 19 '21 08:08 macobo

I agree that this is pretty much correct behavior analytics-wise. As for A vs ¬A, we can add a "not in cohort" series option to the current only "in cohort", but that would get messy with multiple cohorts, i.e. series: A, B, C, and ¬(A∨B∨C) wouldn't actually make sense, since the overlap between any of A, B, and C can be anywhere between none or full.

Twixes avatar Aug 19 '21 08:08 Twixes

Isn't a breakdown basically a group by operation? When I pick breakdown by browser, I see the resulting trend grouped by each browser name in order of distribution. This replaces the baseline conversion shown otherwise. When I pick cohorts, I see the trend grouped by each cohort I add. In each case we're dropping the baseline.

Maybe this is as simple as always including the baseline trend or adding an option to toggle the baseline on and off? I was working on this for funnels, but it's totally applicable to other insights types as well. We need some means of configuring the resulting chart to show just the metrics / groupings you're interested in. In this example, the legend is being used to toggle specific values on and off in the display. This is showing browsers and comparison ranges, but the same approach should work for multiple cohorts. Thoughts?

Screen Shot 2021-08-19 at 9 04 23 AM

clarkus avatar Aug 19 '21 16:08 clarkus

Related https://github.com/PostHog/posthog/issues/5659

clarkus avatar Aug 19 '21 16:08 clarkus

Should we turn this from a bug ticket into an enhancement ticket (since we wish to include new behavior here)? Not sure we want to change anything here immediately and if we do make a change it will be for trends and funnels both.

macobo avatar Aug 20 '21 09:08 macobo

Yeah, I agree, there's no bug but maybe there is possibility for the feature to be enhanced for clarity.

Twixes avatar Aug 23 '21 10:08 Twixes

+1 for this :)

raquelmsmith avatar Jan 10 '23 21:01 raquelmsmith