In & Not In
These filter types are available for Text, Number, Decimal, EmailAddress, Phone, and Locale field types.
In filter type
The In filter type allows you to select records that contain specific values within a defined attribute or field. It’s ideal when you want to target customers who belong to one or more groups, or have specific values assigned to them.
How it works
The filter will match any record where the attribute matches one of the values you’ve defined. You can specify a list of values to include in the filter, making it more flexible and accurate.
Example
Let’s say you are working with a segment of customers in a loyalty program, and you want to target customers who belong to specific cities or regions. You can use the In filter to include all customers from the cities you are targeting.
Not In filter type
The Not In filter type is the opposite of the In filter. It allows you to exclude records with specific values from the segment. This is useful when you want to target everyone except customers who belong to certain groups, have specific attributes, or fall into particular categories.
How it works
- The filter will exclude any record that contains one of the specified values.
- It’s useful for narrowing down your audience by excluding unwanted groups or attributes.
Example
Imagine you want to send a promotional email to customers, but you need to exclude those who have already opted out and pause of email communications. You can use the Not In filter to exclude customers who have opted out.
Work with numbers & decimal field types
In and Not In filter types can be used to match for a field that is either equal or not equal to one of the given values ensuring that the values are separated with a comma. Note that signed integers (+ and -) are recognized and can be used as values when using In/Not In filter types.
To type in multiple Number and Decimal values, ensure to separate each value with a comma. Upon doing so, each number value will be tagged as a single value and will be automatically sorted ascendingly.
For high number values (e.g. 1,800 or 1.800) neither comma nor dot should be included for the number value (e.g. 1800).
Work with empty values
The In and Not In filters always exclude all the empty (null) values. This configuration, inherited from the standard SQL practice, determines that, when comparing an empty value to any other value, it is neither equal nor different, but indeterminate. Therefore, empty values are excluded, because it's never going to be "equal" or "distinct" restrictively to the values provided.
Example
Take this table:
Id | First Name | Country |
|---|---|---|
1 | Mathiew | Belgium |
2 | Tom | France |
3 | Eduardo | Spain |
4 | Sameer | <empty or null> |
If you create a Selection and apply the following filter:
The outcome will be:
Id | First Name | Country |
|---|---|---|
3 | Eduardo | Spain |
As you can see, Id 4 will be excluded, because it's empty.
If we want to keep empty values as well as values distinct to Belgium and France, you will need to add another filter that explicitly includes empty values:
In this case, the outcome will be:
Id | First Name | Country |
|---|---|---|
3 | Eduardo | Spain |
4 | Sameer | <empty or null> |