For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.
Build charts in Amplitude: Modify a user segment
Property filters narrow a user segment to events whose properties match specific conditions. Use an inline filter for a chart-specific question; save the segment when you need to reuse the same conditions across analyses. You can combine property conditions with AND and OR logic to define precise groups.
Add a filter
When you add properties to a segment definition, remember that you're specifying the property values at the time of each event.
For example, imagine you add the filter where City = Amsterdam to your segment. If a user triggers an event where City = Amsterdam, but more recently triggered an event where Country = United Kingdom, Amplitude includes only the event that matches your filter in the chart. To query an event based on a user property, set the user property before the user logs that event.
If you segment by Device ID, Event ID, Latitude, Longitude, Server Upload Time, Session ID, User ID, or ID, specify the exact values you're looking for. You can't group by the user properties Event ID, Latitude, Longitude, Server Upload Time, or ID.
To apply a filter to your user segment, follow these steps:
- Click + Filter by under your user segment. Don't click + Filter by underneath your event.
- In the Select property... menu, select the user property or behavioral cohort you want to add to the filter.
- Select the value of the user property you want to include (or specifically exclude).
- Select the operator that defines how the filter uses this property:
is,is not,contains,does not contain,less/greater than (or equal to),set is,set is not,set contains,set does not contain, andglob match.
If you enter more than one property value, the operator acts as an OR statement. To create an AND statement, add another Filter by clause.
isoris not: Include or exclude exact property values in your segment definition.containsordoes not contain: Include or exclude property values with a specific substring in your segment definition. This operator isn't case sensitive.starts withordoes not start with: Include or exclude property values with a specific prefix string in your segment definition. This operator isn't case sensitive.set isorset is not: Include or exclude specific array sets.For example, define a segment that includes users with an array set of
MoviesandMusicasInterests {=} Movies, Music.This means the user's array set must exactly includeMoviesandMusic. If the user only hasMovies, they don't meet the definition. Likewise, if the user hasSports,Movies, andMusic, they don't meet the definition.set containsorset does not contain: These operators match list values that contain all the selected values, or list values that don't contain all the selected values, respectively. Use these operators to view people who belong to multiple A/B test groups.- To exclude certain values from a property array, use
set does not contain. - If you select multiple values, these operators apply an
ANDstatement to the values. For example, with the conditionset does not contain group A and group B, a user must be NOT in group A AND group B to qualify for exclusion. To apply an OR statement, use multipleset does not containfilters.
- To exclude certain values from a property array, use
glob matchorglob does not match: Amplitude has a simple version of regular expressions that lets you match or exclude strings like/org/*/chart/*where*is a wildcard. You can also enter strings like*[0-9]or[!a-z]*to match values that end in a digit or start with a non-letter. For more information, refer to the Wikipedia article on Glob.- The asterisk only matches non-
/characters. To search for strings that contain/, use two asterisks instead. For example, if your URL format iswww.example.com/blogs/blog_id, and you want to filter all URLs that contain the word "blog," use glob match and enter**blog**.
- The asterisk only matches non-
For more information, refer to how array operators work in Amplitude.
To change the name of your segment, hover over its current name and click it. This also changes the segment's name in any charts that already use it.
Using an OR clause
To filter on multiple values of the same property, add more values in the Select value(s)... box. This creates an OR clause in the segment's definition. In the screenshot below, the segment now includes users who fired an event in the United States OR the United Kingdom OR Japan.
This doesn't apply when you set your operator to set is or set is not.
Using an AND clause
Adding another filter creates an AND clause in your segment definition. To add more filters, click + Filter by.
Filter by Event Time
An Event Time filter matches events by the date and time when they occurred. Use Event Time when a segment should include events from one or more specific periods. Use the chart date picker instead when the same overall time range should apply to the entire chart.
- Add a filter to a chart segment or a Segments V2 event condition.
- Select Event Time from Amplitude Event Properties.
- Select a comparison operator, then enter a date and time. Amplitude interprets the value in your project's timezone.
- Add start and end Event Time conditions, then join them with AND to define a range. Join each range with OR to include multiple ranges.
Use is greater than or equal to for an inclusive start and is less than for an exclusive end. The is operator matches one exact instant, not an entire calendar day.
Event Time isn't available as a group-by property.
Was this helpful?