Cohorts
- A Cohort represents a subset of a Dataset. Definition of the cohort identifies the set of dataset records which are included in the cohort. Within the catalog, the cohort manifests as a boolean-valued property associated with the dataset. Only the records for which this property is True are included in the cohort.
- For example, imagine that you have a Users dataset which has a record per user and a Page Views dataset which contains a record per user per page view event for that user. Using the Cohorts feature, you can define a cohort on the Users dataset which will only select those users who have an aggregate of 10 or more Page Views during the last week.
- In general, the definition of a Cohort may include arbitrary computation as long as the result can be presented at the level of each record of the target dataset. For example, it may include joins with other datasets, filters, aggregations, etc.
- A Cohort can be used anywhere in the app that the Catalog is accessible or within the Segments section inside any Exploration template. Its usage through the Catalog is similar to any other columns in the dataset.
- The configuration for a Cohort is saved within NetSpring and accessible through the Catalog. It can be utilized like any other column within the dataset through the catalog.
A cohort has the following configuration:
Configuration | Description |
---|---|
Dataset | The dataset that a cohort is associated with. A given cohort is associated with exactly one dataset, which must be selected at the time of defining the cohort. The cohort appears in the catalog just like any other column of that dataset and can be used in any analysis that has access to the catalog. A cohort cannot be moved from one dataset to another. |
Name | The name of a cohort must be unique across all columns (including cohorts and cohorts) for that dataset. |
Definition | The computation for a cohort is specified using the Block Editor. |
Creating a New Cohort
Creating a New Saved Cohort
- In the Left Navigation Panel, click + and then select Cohort.
- Select one of the templates shown in the options. The following are the options available for you to choose from:
Type | Description |
---|---|
Behavioral | This template allows you to determine a cohort of actors based on their attributes and/or behaviours. |
Formula | This template allows you to calculate a cohort of values based on arithmetic and logical operators. |
Conditional on property | This template allows you to create a cohort using and/or logic based on dataset properties. |
Custom | This template allows you to calculate a cohort of values by composing any number of blocks. |
Conditional on Aggregate | This template allows you to calculate an aggregated quantity per actor to decide inclusion in the cohort. |
Conditional on intervals engaged | This template allows you to calculate how many distinct time intervals each actor engaged in some behaviour. |
- Select a Dataset for the new cohort.
- In the Block Editor interface, define the computation for your cohort.
- As you work on the definition of the cohort, click on Run Cohort to preview the computed values.
- Click on the top-left to specify a name and description for the Cohort.
- Click Save to save the cohort's definition in the Catalog.
- The new cohort can now be used anywhere, e.g. inside exploration templates, block editor, etc. It can also be accessed in any of the Exploration templates under the Segment by Cohort section.

Defining an Inline Cohrt
- Inside an Exploration template such as Retention, navigate to the Segment by Cohort section.
- Click + to add a new cohort and then click New cohort and a new Behavioral Cohort will be added.
- Set the condition for your cohort and click Apply.
- The created block will now be selected in the Segment by Cohort section.
- Define additional blocks if necessary to complete the definition and run the exploration to see segmented results.

Audience
An audience is a cohort that is published to the warehouse. There are two types of audience:
- Table - Publishes the current snapshot of audience members as a physical table.
- View - Publishes audience definition as a logical view with audience members always live.
Publishing cohorts to the warehouse
Here's how you can publish a cohort to your data warehouse.
- Navigate to Cohorts in the left navigation panel and create a cohort or choose an existing one.
- Click the three dots on the top-right corner next to the Save button. From the drop-down, choose Publish Audience. Choosing this option prompts the user to enter the following details:
- Audience Name - Name for the cohort that is to be published in the warehouse.
- Audience Description - Description for the cohort that is to be published in the warehouse.
- Type - The cohort is saved as a View or Table in the warehouse depending on the Table/View option user has selected under Type.
- Sync - The cron job that updates the table periodically.
The audience membership can be refreshed periodically when published as a table or a view.
- Once the configuration is done, click Save. All published audience will be visible under the Audiences tab inside the Cohorts section.
- Once saved, you can also see options like Run now and Resume sync.

Inside the Audiences section, clicking on the three dots corresponding to each published cohort will display the following options.
- Delete an audience which deletes the table/view in the data warehouse.
- Refresh the audience which re-populates the audience based on the new definition of the cohort or based on new data (This is relevant only for tables and not for views).
- Edit the schedule for previously scheduled audience updates (This is also relevant only for tables and not for views).

Remember to configure details about your warehouse database and schema where the data needs to be published. Learn more.
Types of Cohorts
NetSpring has a range of cohort templates that allow you to get started easily and quickly. Choosing a template is the first step in creating a new cohort and you can change this at any time without losing any work. Let's look at how each of these templates can be configured.
We use a demo app called Flix to create these sample metrics. You can also see these examples inside the app.
Behavioral
The Behavioral template lets you create a cohort of actors based on their attributes and/or behavior. The advantage of using this template is that you can create cohorts that are tailored based on user behavior that is specific to your business and not just any user behavior in general. Here's how you can create one.
- Navigate to + on the left navigation panel, click Cohorts and choose Behavioral.
- As an example, let us create a cohort of users who made a purchase within 7 days of signup.
- Choose a dataset from the drop-down and click Confirm. Here, we choose the Users dataset.
- Give your cohort a name and add a description(optional).
- Next, set the condition in the Blocks section. For the condition, choose did from the drop-down and select the event - here, we choose Make Purchase from Product Events and click Apply.
- Then, set the time range. Here, it will be 'Within 7 days after timestamp' and the value will be the Sign Up Date derived column.
- Then, we add an aggregate filter where we set the count to >= 1.
- Click Apply and then Run Cohort.
- Click Save to save all your changes.

Formula
The formula template in NetSpring allows you to create a cohort of values based on arithmetic and logical operators.
- Navigate to + on the left navigation panel, click Cohorts and choose Formula.
- Choose a dataset - here, we choose the Users dataset.
- Give your cohort a name and add a description(optional).
- As an example, let us create a cohort of users who use the dot com domain.
- In the Blocks section, enter the formula: regexp_substr(Data.Users.id, '[^\ .] $') == 'com'
- Click Run Cohort.
- Click Save to save all your changes.

Conditional on property
This template allows you to create a cohort using and/or logic based on dataset properties.
- Navigate to + on the left navigation panel, click Cohorts and choose Conditional on property.
- Choose a dataset - here, we choose the Users dataset.
- Give your cohort a name and add a description(optional).
- As an example, let us create a cohort of Active. In the And/Or block, enter the logic: choose the Purchased in Last 30 Days cohort and set the value to True, choose the Viewed Similar Content - L30D cohort and set the value to True.
- Next, add another condition - choose the Total Time Viewed metric and set the value to 500.
- Click Run Cohort.
- Click Save to save all your changes.

Custom
This template allows you to calculate a cohort of values by composing any number of blocks.
- Navigate to + on the left navigation panel, click Cohorts and choose Custom.
- Choose a dataset - here, we choose the Subscriptions dataset.
- Give your cohort a name and add a description(optional).
- As an example, let us create a cohort for Regular Subscriptions. A regular subscription is one for which at least half of its associated users are regular watchers. A regular watcher is a user who has played content on at least 5 distinct days in the last 30 days.
- In the Blocks section, add a new Aggregate block. Set the aggregator to count and choose the Users dataset from the drop-down. Let us call this the Overall Users block.
- Add another aggregate block to calculate the number of Regular Users. Set the aggregator to count and choose the Users dataset from the drop-down. Add a filter as follows: where Regular Watchers is True. See how the Regular Watchers cohort is created.
- Then, add a formula block to calculate regular subscriptions. Enter the following formula: "Regular Users" / "Overall Users" >= 0.5.
- Click Run Cohort.
- Click Save to save all your changes.

Conditional on Aggregate
This template allows you to calculate an aggregated quantity per actor to decide inclusion in the cohort.
- Navigate to + on the left navigation panel, click Cohorts and choose Conditional on Aggregate.
- Choose a dataset from the drop-down and click Confirm. Here, we choose the Users dataset.
- Give your cohort a name and add a description(optional).
- As an example, let us create a cohort of Heavily Marketed Users in the USA. In the And/Or section, set the condition as follows: country in USA, CAN, AUS. Let us call this the Heavily marketed users block.
- Go to the Aggregate block. Choose the count aggregator from the drop-down and choose Heavily Marketed Users as the value.
- Click Run Cohort.
- Click Save to save all your changes.

Conditional on intervals engaged
This template allows you to calculate how many distinct time intervals each actor engaged in some behaviour.
- Navigate to + on the left navigation panel, click Cohorts and choose Conditional on intervals engaged.
- Choose a dataset - here, we choose the Users dataset.
- Give your cohort a name and add a description(optional).
- As an example, let us create a cohort of Regular Watchers. Here, a regular watcher is a user who has played content on at least 5 distinct days in the last 30 days.
- First, let us calculate the number of days on which content was played. In the Intervals engaged block, choose count of distinct days from the drop-down and select the Users dataset. Set the condition as did Play Content. Add a filter with the following configuration: where event time in Last 30 days at least 1 time and at most unbounded time. Let us call this the Days Played block.
- Next, let us add an And/Or block to calculate the number of users who played content regulary on at least 5 days. Set the condition as follows: where Days Played >= 5.
- Click Run Cohort.
- Click Save to save all your changes.

Viewing Cohorts
Cohorts Section
- In the Left Navigation Panel, select the icon which says Cohorts.
- The resulting page lists a set of templates at the top for defining new cohorts. Underneath that is a search bar to find individual cohorts by name. Below that is a paginated listing of all cohorts in the system, pooled across all datasets.
- Each cohort entry in the listing contains the following information:
- Name
- Description (if any)
- Type (this refers to the template used when defining the cohort).
- Updated By
- Updated At

Dataset Page
Alternatively, all cohorts for a given dataset can also be accessed from inside the dataset page by clicking on the "Cohorts" tab there.