Prerequisites
- A connected data warehouse. For more information, refer to Connect Your Data Warehouse.
- Your warehouse tables mapped to MoEngage users, events, and attributes. Your data or engineering team does this once in Warehouse Schema. Only mapped columns appear in the dropdowns.
The filter builder supports BigQuery and Databricks.
Build a Segment
Building an audience and acting on it are two separate steps. You define filters and run them to get a count, and the result lands in Query results, where you turn it into a segment, a campaign, or an export. To build a warehouse segment, perform the following steps:- On the sidebar menu in MoEngage, click Segment > Warehouse Segments. The Warehouse Segments page appears.
- Select your warehouse connection from the dropdown beside the page title. The attributes and events mapped from that connection load into the filter dropdowns.
- Select the Filter tab.

- Build your audience in the filter block. Each block filters on either a User property or a User behavior. Use the toggle to switch between them.
- To narrow the same block further, click + Nested Filter.
- To add a separate condition, click + Filter.
- To remove everyone matching a condition instead of including them, select Exclude Users.
- To start over, click Reset Filters.
- Click Show count. MoEngage builds the SQL, runs it against your warehouse, and adds a row to Query results below.
- In Query results, click the ellipsis icon on the row and select what to do with the audience. For more information, refer to Act on the Result.
There is no save button on this page. A warehouse segment becomes reusable only when you create a custom segment from a query result.
Filter on User Properties
Select User property in a filter block to filter on the properties mapped from your user master table. Each row reads as attribute, operator, then value.
Filter on User Behavior
Select User behavior in a filter block to filter on what users did. Choose Has Executed or Has Not Executed, select the event, then set how many times and over what period.
- + Attributes narrows the filter to specific event attribute values, such as an order above a certain amount.
- + Aggregation filters on a computed value across the matching events rather than on a count of them.
Event Occurrence Operators
Set how many times a user performed the event:for the first time and for the last time are bounded by the Max event look-back window set on your warehouse connection, which is 60 days by default. An event that first occurred before that window looks like a first occurrence inside it.
Operators by Data Type
Available operators depend on the MoEngage data type your team mapped the column to.
You can also compare one attribute against another, and use special date filters, as you can in rule-based segments. For more information, refer to Filters in Segmentation.
Read the Query Results
Every time you click Show count, MoEngage adds a row to Query results. Each row records what you ran and what it returned.
Click the refresh icon to re-run a query without rebuilding the filters.
The user count is usually smaller than the number of rows your warehouse matched. A row becomes a user only if its user identifier matches a user already in MoEngage. If your warehouse returns 1,000 rows and 90 of those users exist in MoEngage, the count is 90.That number is not fixed either. The same query can resolve to more users later, as those users become known to MoEngage.
Act on the Result
Click the ellipsis icon on a query result row to choose what to do with the audience.
When Queries Run
MoEngage queries your warehouse at three points: when you click Show count, when you re-run a query result or a saved custom segment, and automatically at campaign run time for any campaign using a segment built this way.After You Create a Custom Segment
A custom segment created from a query result behaves like any other custom segment on the All Segments page, where it appears with the type Warehouse - filter. To show only these segments, select that type in the Select Segment Type list. You can view, edit, duplicate, archive, and create a campaign from the segment. For more information, refer to Manage Segments. The segment detail page shows its type, source connection, creation date, last run time, user count, reachability, and edit history. Running the segment from this page refreshes the user count by re-querying your warehouse. Exports return MoEngage attributes. MoEngage cannot resolve warehouse attribute values during an export, so warehouse columns are not included.Limitations
The filter builder does not support:- All Users segments. Every warehouse segment needs at least one filter.
- Value suggestions. Attribute value dropdowns stay empty, so type values manually.
- Analyse. A warehouse segment cannot be used as the audience for an analysis.
- Custom segment, affinity, and analytics filters inside a warehouse segment.
Unsupported Attribute Types
Attributes of these types cannot be filtered on, because they are not mappable in a warehouse schema:- Object and object array attributes.
- Location attributes.
- Boolean arrays and date arrays.
Unsupported Aggregations
Aggregating on a warehouse attribute is not available yet. The following aggregations are not supported at all:- Median.
- Change and percentage change.
One Connection per Query
A query reads from one warehouse connection. To combine data across connections, create a custom segment per connection and combine those on the standard segment builder.When a Segment Breaks
A warehouse segment depends on the warehouse tables behind it staying as they were mapped. If a column is renamed, a table is dropped, or a data type changes, the segment stops working. If a segment stops returning a count, ask your data team to check the mapping in Warehouse Schema. Once it is corrected, run the segment again.Frequently Asked Questions
Why is my segment smaller than the number of rows returned?
Why is my segment smaller than the number of rows returned?
MoEngage only targets users it already knows. A row in your warehouse becomes a segment member only if its user identifier matches a customer ID in MoEngage. Rows for users MoEngage has never seen are skipped.Mapping a warehouse schema does not import users. To bring new users into MoEngage, use Imports.
I added a column in my warehouse but cannot find it in the dropdown.
I added a column in my warehouse but cannot find it in the dropdown.
Two things have to happen first.MoEngage refreshes warehouse metadata every 6 hours, so a column added just now may not be visible yet. Your data team can use Force refresh on the schema to pick it up sooner.Then the column has to be mapped. Unmapped and skipped columns never appear in the segment builder, even after a refresh.
Why are the attribute value dropdowns empty?
Why are the attribute value dropdowns empty?
Value suggestions are not available for warehouse attributes. Listing the distinct values of a column means scanning the whole table in your warehouse, which is slow and costly, so MoEngage does not do it automatically.Type the value you want to filter on. It must match what is stored in your warehouse, including capitalisation.
Can I combine warehouse data with data already in MoEngage?
Can I combine warehouse data with data already in MoEngage?
Not inside a single warehouse segment, because one segment reads from one connection.Run your warehouse filters, then use Create custom segment on the query result. That custom segment can be combined with MoEngage attributes and events on the standard segment builder.
Does the segment refresh on its own?
Does the segment refresh on its own?
A segment used in a campaign refreshes automatically at campaign run time, so the campaign targets a current audience.Elsewhere, the count you see is from the last run. Run the segment from its detail page to refresh it.
How far back does event data go?
How far back does event data go?
As far back as the Max event look-back window set on your warehouse connection, which defaults to 60 days. Events older than that are not visible to any filter, including for the first time.Your data team sets this in Settings > Data > Warehouse Schema. Longer windows scan more data and cost more to query.
My segment worked last week and is failing now.
My segment worked last week and is failing now.
Something in the underlying warehouse table most likely changed, such as a renamed or dropped column, a changed data type, or a deleted schema. MoEngage does not warn you when this happens, so a working segment can start failing without notice.Ask your data team to review the mapping in Warehouse Schema. Once it is corrected, run the segment again.
Why can I not run an analysis on a warehouse segment?
Why can I not run an analysis on a warehouse segment?
Analysis needs event data stored inside MoEngage. A warehouse segment resolves to a list of users at run time and carries no warehouse event history with it, so there is nothing for an analysis to read.You can still target the segment with campaigns and see campaign performance as normal.