Segmented Keys¶
Segmented keys (also called segmented fields) allow you to work with multi-valued attributes in your data. Instead of treating a comma-separated list as a single value, u-Slicer breaks it down into individual segments and lets you analyze each one separately.
What Are Segmented Keys?¶
In advertising data, a single record often belongs to multiple categories simultaneously. For example:
- A user may have multiple interests (Sports, Travel, Technology)
- An ad placement may appear on sites in several content categories
- A campaign may target multiple audience segments
When these multi-valued attributes are stored as comma-separated lists (e.g., "Sports, Travel, Technology"), u-Slicer can treat them as segmented keys. This enables analysis where each segment is counted and filtered independently.
How Segmented Keys Work¶
Data Expansion¶
When you split by a segmented key, u-Slicer expands each record so that every segment value gets its own row in the result. The metric values are attributed to each segment.
Example: Raw aggregated data by User Interests
| User Interests | Impressions |
|---|---|
| Sports, Travel, Tech, Fashion | 10,000 |
| Travel, Fashion | 25,000 |
| Tech | 30,000 |
| Tech, Fashion | 40,000 |
| Fashion | 50,000 |
| Total | 155,000 |
Result after splitting by the segmented "User Interests" key:
| User Interests | Impressions |
|---|---|
| Sports | 10,000 |
| Travel | 35,000 |
| Tech | 80,000 |
| Fashion | 125,000 |
| Total | 155,000 |
Each interest segment now has its own row with the sum of impressions from all records that contain that interest.
Understanding the Total Row¶
Important: The Total row shows the actual total from the original data, not the sum of the expanded rows.
In the example above: - Sum of expanded rows: 10,000 + 35,000 + 80,000 + 125,000 = 250,000 - Actual Total: 155,000
This difference exists because records with multiple segments contribute to multiple rows after expansion. Users interested in Sports, Travel, Tech, Fashion contribute their 10,000 impressions to all four interest rows.
Filtering Segmented Keys¶
When you filter by a segmented key, the filter checks whether any segment in the list matches the condition. This is different from regular keys where the entire value must match.
Available Filter Operations¶
| Operation | Behavior for Segmented Keys |
|---|---|
| equals | Any segment equals the value |
| not equals | No segment equals the value |
| contains | Any segment contains the substring |
| not contains | No segment contains the substring |
| begins with | Any segment starts with the substring |
| not begins with | No segment starts with the substring |
| ends with | Any segment ends with the substring |
| not ends with | No segment ends with the substring |
All matching is case-insensitive.
Single Value Filter¶
Using the filter panel, select the segmented key field, choose equals, and enter a value:
Filter: User Interests equals "Fashion"
This returns all records where "Fashion" is one of the user interests (not necessarily the only interest).
| User Interests | Impressions |
|---|---|
| Sports | 10,000 |
| Travel | 35,000 |
| Tech | 50,000 |
| Fashion | 125,000 |
| Total | 125,000 |
The Total is 125,000 because only records containing "Fashion" interest are included:
- Sports, Travel, Tech, Fashion (10,000) + Travel, Fashion (25,000) + Tech, Fashion (40,000) + Fashion (50,000) = 125,000
Multiple Values (OR)¶
Click the + or button to add multiple values to the same filter. Records matching any of the values will be included.
Filter: User Interests equals "Sports" + or "Tech"
This returns records where users have either "Sports" or "Tech" interest (or both).
| User Interests | Impressions |
|---|---|
| Sports | 10,000 |
| Travel | 10,000 |
| Tech | 80,000 |
| Fashion | 50,000 |
| Total | 80,000 |
Matching records: Sports, Travel, Tech, Fashion (10,000) + Tech (30,000) + Tech, Fashion (40,000) = 80,000 impressions.
Multiple Filters (AND)¶
Click Add Filter to add another filter condition. Records must match all filter conditions.
Filters:
- User Interests equals "Tech"
- User Interests equals "Fashion"
This returns only records where users have both "Tech" and "Fashion" interests.
| User Interests | Impressions |
|---|---|
| Sports | 10,000 |
| Travel | 10,000 |
| Tech | 50,000 |
| Fashion | 50,000 |
| Total | 50,000 |
Only two original records match: Sports, Travel, Tech, Fashion (10,000) and Tech, Fashion (40,000), totaling 50,000 impressions.
Using Segmented Keys in Formulas¶
Segmented keys can be used in custom column formulas with the IF() and Filter() functions.
IF() Function¶
IF(segment_key = "value", metric_a, metric_b)
The equality check returns true if the record's segment list contains the specified value.
Example:
IF(user_interests = "Sports", revenue, 0)
This returns revenue for all records where "Sports" is one of the user interests.
Filter() Function¶
Filter(segment_key = "value", expression)
Example:
Filter(user_interests = "Sports", clicks / impressions)
This calculates the click-through rate only for records with users interested in "Sports".
Supported Operators in Formulas¶
For segmented keys in formulas, only = and != are supported. Other comparison operators (<, >, <=, >=) will produce an error.
Audience (Count Distinct) with Segmented Keys¶
When calculating audience size (count distinct) with a segmented split key, each unique user is counted in every segment they belong to.
Example: If user A has interests Sports, Travel, they will be counted once in the "Sports" row and once in the "Travel" row. The Total remains accurate — user A is counted only once there.
Key Behaviors Summary¶
| Aspect | Behavior |
|---|---|
| Split by | Each segment becomes a separate row; metrics are attributed to each matching segment |
| Total row | Shows actual total from original data, not sum of expanded rows |
| Filtering | Checks if any segment matches the condition |
| Case sensitivity | All matching is case-insensitive |
| Empty/null segments | Treated as empty strings |