Solved

Dynamic cohorts based on combination of criteria

  • 18 May 2023
  • 6 replies
  • 139 views

Hi Team,

I’m looking to create a cohort with a combination of multiple criteria's. Something like, users who performed “A” or “B” or “C” and then performed “X” or “Y”. 

Any easy way to do it? 

icon

Best answer by Saish Redkar 18 May 2023, 07:54

View original

6 replies

Userlevel 7
Badge +10

Hi @Vaibhav Gangakhedkar 

From the cohort building screen, it’s possible to create a cohort by chaining together the event performed clauses using several “or”s + “and”s, but the ‘then’ part isn’t supported yet afaik.

One of the alternate approaches here would be to create a custom event for your events A/B/C and X/Y → use these two custom events in a funnel analysis chart →  create the cohort using the funnel’s converted datapoint via Microscope.

Let me know if I have interpreted your use case correctly. Hope this helps.

Got it! sounds like a good idea, let me try that. 

Userlevel 4
Badge +8

Hey @Vaibhav Gangakhedkar , adding to @Saish Redkar ‘s recommendations above to highlight then logic that is available in cohorts.

Step 1:

You can build 2 separate custom event on the optional events

  • users who performed “A” or “B” or “C” 
  • users who performed “X” or “Y”

Step 2: 

Then in a cohort you can apply the following “funnel order” logic

  • users who performed custom event 1
  • then users who performed custom event 2

 

Here is a sample cohort leveraging this then logic with 2 custom events in our Demo AmpliTunes org. 

 

The key difference is the cohort built from the Microscope function will be a static cohort limited to the original chart’s conversion window & time range lookback period. 

Meanwhile the “funnel order” logic embedded within the cohort will enable your cohort to continually enter & exit new users with your defined conversion window & time range.

 

I hope this helps!

Userlevel 7
Badge +10

Ah! Thanks @JennRu for pointing that out!
Looks like the then clause eluded me for a while now while building cohorts 😄
It appears to be fleeting depending on if the event is already selected in the or clause or not. I can see that now

 

@Vaibhav GangakhedkarFollow Jenn’s steps to get the dynamic nature for your cohort.

Thanks @JennRu and @Saish Redkar :) this makes more sense. Btw, just as a suggestion, and i know that there would be multiple cases where such a function would be required to have multiple “Or” and “Then” conditions in the same cohort, can this be suggested as a product feature? or an upgrade to the existing one? 

Userlevel 4
Badge +8

@Vaibhav Gangakhedkar completely agree, this is a strong use case and perhaps it doesn’t always make sense to build a custom event if it’s only going to be leveraged in a few inventory. 

An alternative suggestion on how this could be built, if you wish to bypass the need for a custom event - you could leverage the Any Event syntax where Event Name = Event A or Event B, similar to the screenshot below. The caveat to this example is that you can’t specify different properties for each event. 

So if you needed to set the granular conditions below, then a custom event would be required at this time to support this use case.

  • Event A where Property A = x 
  • OR Event B where Property B = y

I updated the sample cohort referenced above to factor in this setup as well.

 

And I don’t believe we have a cap on how many “Then” conditions can be added within a cohort

 

 

If you have an additional use case that you’d like to setup outside of these proposed parameters, please submit this feedback in-product in the bottom right Amplitude logo widget to our ProductBoard feedback submission form. That will greatly help the product team prioritize the request, thanks!

 

Reply