1. What are filtering condition

The filtering condition is to filter the data set we get by setting a condition to get the sub-data set we finally want to analyze. All of our analysis features have the option of filtering criteria, which can be filtered according to the attributes of the event or filtered according to the attributes of the user.

The filter is analogous to the where condition statement in SQL.

When user filters are used, the where condition applies to the users table; When event filters are used, the where condition applies to the events table.

2. Use process

In all the analysis functions of Sensorsdata, when we can see the "Filter", "global filter" and other buttons, it means that users or events can be filtered here. Refer to the logo in the figure above. The specific configuration process is as follows:

  1. Click the filter input box to add one or more filters at the same time.
  2. Select properties for filtering events or users in B.
  3. Select the judgment type of the attribute in C, different attribute types have different judgment types, the use of different judgment types can be referred to Part 3.
  4. After entering the judgment value in option D, the analysis results will be filtered according to the input criteria.

3. Filter classification

3.1. By target

Filter users: The filter applies to the user table to see only those users that meet the filter criteria. Generally, conditions are set on user attributes, or users are selected to obtain users that meet the analysis conditions.

Filter events: Filter conditions are applied to events, and only the events that meet the filter conditions are looked at. Conditions are usually set on event properties.

3.2. By data type

Whether it is to screen different users or screen different events, the specific setting of each filter condition can be understood according to its data type.

3.2.1. String type attribute filtering

When the filter attribute is a string type, you can see the judgment types identified in the figure above. The use of each judgment type can refer to the following table:

Judgment typeanalogy SQLDescription description
Equals=Exact match. The event will only be analyzed if the selected event property is equal to the input judgment value. When there are multiple judgment values, the event will be included in the analysis dataset if the event property value is equal to any of them.
Not equals!=Exact match. The event will only be analyzed if the selected event property is not equal to the input judgment value. When there are multiple judgment values, the event will not be included in the analysis process if the event property value is equal to any of them.
IncludeLIKE "%$Judgment Value%"Matching operation. The event or user will be included in the analysis process if the attribute field contains the judgment value.
ExcludeNOT LIKE "%$Judgment Value%"Matching operation. Opposite of "Contains". The event will not be included in the analysis process if the attribute field contains the judgment value.
is not emptyLength($Attribute)>0The event or user will only be included in the analysis process when the attribute field has a value (string length greater than 0).
Empty=""The event or user will only be included in the analysis process when the attribute field value is an empty string.
is nullIS NULLThe event or user will only be included in the analysis process if the attribute field is equal to NULL.
is not nullIS NOT NULLThe event or user will only be included in the analysis process if the attribute field is not equal to NULL.
match RegExp
Matching judgment, eligible data into the analysis process. For details, please refer to:regular expression
mismatch RegExp
For matching judgment, only data that does not meet the regular condition enters the analysis process. For details, please refer to:regular expression

3.2.2. Numeric type attribute filtering


When the selected attribute is a number type, you can see the judgment types identified in the figure above. The use of each judgment type can refer to the following table:

Judgment typeAnalog expressionDescription description
Equal to=Similar to the string type
Not Equal to!=Similar to the string type
less than<Events whose selected attribute value is less than the judged value enter the analysis process
More than>Events whose selected attribute value is greater than the judged value enter the analysis process
intervalbetween . and .Events will enter the analysis process only when the selected attribute values are within the closed interval formed by the set judgment values; for example, if the judgment values are set to 10 and 100, the selected attribute values need to satisfy the [10, 100] interval.
is not nullIS NOT NULLSimilar to string types
is nullIS NULLSimilar to string types

3.2.3. Time attribute filtering

Glossary

  • Absolute time: a fixed time range with a clear start and end time
  • Interval period: a fixed period interval with a clear start and end period
  • Relative time: a time range with a clear start and end time point relative to a certain time point
  • Relative to the current time point: a time range before the current time point, such as 1 hour ago
  • Relative current time interval: a time range relative to the current time point with a clear start and end time

When filtering attributes are time types, you can see the judgment types shown in the figure above. The usage of each judgment type can refer to the following:

Absolute time

For example, if absolute time is set from 00:00 to 00:00 on July 4, 2017, data whose time range of the selected attribute is within this interval (including interval endpoints) will enter the analysis process.

Interval period

For example, if interval period is set from 00:00 to 10:59, data whose time range of the selected attribute is within this interval will enter the analysis process.

Relative to the current time point

If the relative current time is within 1 day, it means the time range from the current time reduced by one day as the start point to the current time as the end point. That is, [current time - 1 day, current time]. Note that data is calculated accurately to the day.

For example, when searching on March 22 at 12:05:22 and using "within 1 day from the current time point" as the filter, the result is data whose time range is within the [March 22 00:00:00, March 22 23:59:59] interval.

If the relative current time is 1 day ago, it represents the time interval before one day from the current time point. That is (arbitrary small time, current time - 1 day].

For example, on March 22 at 12:05:22, a query was initiated with a relative interval of one day before the current time point. The result is: data with a time range [- ∞  , March 21st, 23:59:59]

Relative Time Interval

If you set the last 4 days to the last 3 days relative to the current time, when searching on March 22 at 12:05:22, the result is data in the time range [00:00:00 March 20, 23:59:59 March 20]

Relative Event Occurrence Time

Here, the time anchor of the event occurrence is used to set the starting point and end point of the time interval. Therefore, the time interval corresponding to each event or user data to be judged is different.

For example, if we want to see the number of users who registered events before purchasing events within 5 minutes, we can set the registration time to be relative to the event occurrence time within the previous 5 minutes. Based on the hypothesis that "users are attracted to register to buy goods immediately after registration", we can see what types of goods are more likely to attract users to register to buy. Or replace it with a coupon and you can see which type of coupon is more attractive to users.

This "N days before" or "N days after" time interval both includes the current day of the event.

Relative interval of event occurrence time

Here, the time anchor of the event is used to set the starting point and end point of the time interval. Therefore, the time interval corresponding to each event or user data to be judged is different.

For example:

  • If the account opening event is defined as a new user within 30 days of the initial behavior, and "Last 60 days to last 30 days" is defined as an old user, the data within the time range of "last 60 days to last 30 days" is filtered
  • Customers want to analyze the number of times and amount of payments for orders placed 7 days after registration and within 7-14 days.

For example, if we set the relative occurrence time of the event to the past 7 days to the future 4 days, and the event occurrence time is 2023-03-23 18:03:46, the screening range will be [event occurrence time - 7 days, event occurrence time + 4 days].

Is not null & Is null

Please refer to the description of Is not null & Is null in the string type.

3.2.4. Boolean type attribute filtering

When the filtered attribute is of boolean type, you can see the judgment types as shown in the figure above. The specific usage of each judgment type is as follows:

TRUE

This means that data will enter into the analysis process only if the selected attribute value is TRUE.

FALSE

This means that data will enter into the analysis process only if the selected attribute value is FALSE.

Is not null & Is null

Please refer to the description of Is not null & Is null in the string type.

3.2.5. Filters with dictionary type attributes

In the metadata management of Sensors Analytics, you can set the dimension dictionary for the attributes. For the fields that have been set with the dimension dictionary, the filtering conditions are as shown in the following figure, and you can refer to the corresponding types in the String Type for the specific judgment fields to be used.

3.2.6. User group filtering

If the user group is selected during the filter, the condition selection is the same as the Boolean type, indicating whether the user is in the group.