Spend-Based Segmentation
The Spend-Based Segmentation template analyzes how customer spending is distributed across revenue-based segments for specific brands and categories. This helps partners understand their buyer concentration, identify high-value customer cohorts, and inform targeting and media investment strategies.
The template segments buyers into five revenue-based tiers — Top 5%, Top 10%, Top Third, Middle Third, and Bottom Third — based on each buyer's share of cumulative spend within the specified date range. Results can be filtered by brand or category, and each segment row returns average spend, purchase frequency, and buyer share for cohorts of at least 100 users.
You can perform the following actions with this template:
- Analyze buyer concentration across five revenue-based spend segments.
- Scope the analysis to a custom date range of your choosing.
- Filter results by specific brands or product categories.
- Compare average spend and purchase frequency across buyer tiers.
- View the share of total buyers represented by each segment.
Segments with fewer than 100 unique buyers return N/A for metric columns.
Run the query
Use the following query to analyze spend-based segmentation:
set cleanroom_name = 'CLEANROOM_NAME';
call samooha_by_snowflake_local_db.consumer.run_analysis(
$cleanroom_name, -- cleanroom name
'spend_based_segmentation',
[], -- Consumer tables (none needed)
[], -- Provider tables (none needed)
object_construct(
'start_date', '2025-01-01',
'end_date', '2025-12-31',
'brands', ['BRAND_NAME_1','BRAND_NAME_2'],
'categories', ['CATEGORY_NAME_1','CATEGORY_NAME_2']
)
);
Parameters
| Parameter | Description | Data type | Allowed values | Required or optional |
|---|---|---|---|---|
start_date | Sets the start of the analysis period for delivered order dates. | string | Date within the last 3 years, must be before end_date, cannot be in the future. Use the following format: YYYY-MM-DD. | required |
end_date | Sets the end of the analysis period for delivered order dates. | string | Must be after start_date, cannot be in the future, must be at least 30 days after start_date. Use the following format: YYYY-MM-DD. | required |
brands | Filters results to specific brands. | array | Valid brand names available in the dataset. | optional |
categories | Filters results to specific categories. | array | Valid category names available in the dataset. | optional |
Result
| Result | Description |
|---|---|
PARAMS_JSON | A JSON object echoing the query parameters used (start_date, end_date, brands, categories). |
CATEGORY_NAME | The product category for this segment row. |
BRAND_NAME | The brand for this segment row. |
TIME_FRAME | The analysis period displayed as start_date to end_date. |
REVENUE_SEGMENT | The revenue-based segment label: Top 5%, Top 10%, Top Third, Middle Third, or Bottom Third. |
AVERAGE_SPEND | Average total spend per buyer in this segment. Returns N/A if the segment contains fewer than 100 users. |
PURCHASE_FREQUENCY | Average number of deliveries per buyer in this segment. Returns N/A if the segment contains fewer than 100 users. |
USER_PERCENTAGE | Percentage of total buyers that fall within this segment. Returns N/A if the segment contains fewer than 100 users. |
Example result
| CATEGORY_NAME | BRAND_NAME | TIME_FRAME | REVENUE_SEGMENT | AVERAGE_SPEND | PURCHASE_FREQUENCY | USER_PERCENTAGE |
|---|---|---|---|---|---|---|
| CATEGORY_NAME_1 | BRAND_NAME_1 | 2025-01-01 to 2025-12-31 | Top 5% | 312.45 | 8.20 | 1.85 |
| CATEGORY_NAME_1 | BRAND_NAME_1 | 2025-01-01 to 2025-12-31 | Top 10% | 245.80 | 6.75 | 3.92 |
| CATEGORY_NAME_1 | BRAND_NAME_1 | 2025-01-01 to 2025-12-31 | Top Third | 142.30 | 4.50 | 12.15 |
| CATEGORY_NAME_1 | BRAND_NAME_1 | 2025-01-01 to 2025-12-31 | Middle Third | 48.60 | 2.10 | 28.40 |
| CATEGORY_NAME_1 | BRAND_NAME_1 | 2025-01-01 to 2025-12-31 | Bottom Third | 12.75 | 1.20 | 59.45 |
| CATEGORY_NAME_1 | BRAND_NAME_2 | 2025-01-01 to 2025-12-31 | Top 5% | N/A | N/A | N/A |
| CATEGORY_NAME_1 | BRAND_NAME_2 | 2025-01-01 to 2025-12-31 | Top 10% | 198.50 | 5.30 | 4.10 |
Data collection and classification
The Spend-Based Segmentation template organizes and categorizes the data using the following methods:
- Minimum user threshold. Segments containing fewer than 100 unique buyers return N/A for all metric columns (
AVERAGE_SPEND,PURCHASE_FREQUENCY,USER_PERCENTAGE). The segment row is still included in the output. - Revenue-based segmentation. Buyers are ranked by total spend descending. Cumulative revenue is calculated as a walk-down: each buyer is assigned to a segment based on the percentage of total revenue accumulated by all higher-spending buyers before them.
- Date validation. Prevents analysis of data more than 3 years old, in the future, with
start_dateafterend_date, or with fewer than 30 days betweenstart_dateandend_date. - Positive spend filter. Only buyers with total spend greater than zero are included in the analysis.
Segments
The template reports on five segments. The top three are overlapping (cumulative), while the bottom two are mutually exclusive:
| Segment | Definition | Overlap behavior |
|---|---|---|
| Top 5% | Buyers whose cumulative spend falls within the top 5% of total revenue. | Subset of Top 10% and Top Third |
| Top 10% | Buyers within the top 10% of total revenue. | Subset of Top Third |
| Top Third | Buyers within the top 33% of total revenue. | Exclusive with Middle Third and Bottom Third |
| Middle Third | Buyers between 33%–67% of cumulative revenue. | Exclusive with Top Third and Bottom Third |
| Bottom Third | Buyers beyond 67% of cumulative revenue. | Exclusive with Top Third and Middle Third |
Because the top segments overlap, USER_PERCENTAGE for Top 5%, Top 10%, and Top Third should not be summed together. However, Top Third + Middle Third + Bottom Third = 100% of buyers.
Use cases
The following use cases are examples of how this template works:
- Buyer concentration analysis. Understand how concentrated revenue is among top buyers — for example, whether the top 5% of revenue represents only 2% of buyers.
- High-value cohort profiling. Compare average spend and purchase frequency of your top buyers versus middle and bottom tiers to inform loyalty and retention strategies.
- Category-level benchmarking. Compare buyer segmentation across categories to identify where buyer concentration is highest.
- Brand comparison. Analyze how buyer spending distribution differs across brands within the same partner portfolio.
- Targeting strategy. Use segment insights to inform audience targeting — for example, re-engage Middle Third buyers who may be candidates for upsell, or retain Top 5% buyers with loyalty incentives.
- Media investment planning. Understand which buyer segments drive the most revenue to inform where to allocate ad spend.
Best practices
Consider the following best practices when running this query:
- Select date ranges of at least 30 days. Longer periods (90+ days) produce more stable segmentation since buyer behavior has more time to accumulate.
- Use equal-length date ranges. When comparing across time periods, use equal-length date ranges for meaningful comparisons.
- Account for overlapping segments. Remember that Top 5%, Top 10%, and Top Third are overlapping segments. Use the three exclusive thirds (Top Third, Middle Third, Bottom Third) when summing buyer counts or percentages.
- Filter by brands and categories. Use the
brandsandcategoriesfilters to narrow the analysis to specific product areas of interest. - Interpret N/A results. Segments returning N/A indicate fewer than 100 buyers — consider broadening your date range or brand/category filters to increase the buyer population.
Methodology
This template employs various methodologies to gather, analyze, and interpret data.
Segmentation approach
The Spend-Based Segmentation uses a cumulative revenue walk-down to assign buyers into segments:
- Aggregate buyer spend. For each buyer, sum their total spending across all orders within the specified date range, brands, and categories.
- Rank buyers by spend. Order all buyers from highest to lowest total spend within each brand and category grouping.
- Compute cumulative revenue. Walk down the ranked list, keeping a running total of accumulated spend. For each buyer, track how much total revenue was generated by all higher-spending buyers before them.
- Assign segments. A buyer belongs to a segment if the total revenue from all higher-spending buyers is still below the segment's revenue threshold. For example, a buyer is in the Top 5% segment if the combined spend of everyone above them accounts for less than 5% of total revenue.
- Compute segment metrics. For each segment, calculate the average spend per buyer, the average number of deliveries per buyer, and what share of total buyers fall within the segment.
Calculate segmentation metrics
For each segment, the following metrics are computed:
AVERAGE_SPEND. The mean total spend across all buyers in the segment, rounded to two decimal places.PURCHASE_FREQUENCY. The average number of deliveries per buyer in the segment, rounded to two decimal places. Calculated as the total deliveries across all buyers in the segment divided by the number of buyers.USER_PERCENTAGE. The number of buyers in the segment as a percentage of all buyers for that brand and category, rounded to two decimal places.
Limitations and considerations
Keep in mind the following limitations and considerations when using this template:
- Historical data availability. Data availability depends on the underlying order data. The query enforces a maximum lookback of 3 years.
- Minimum date range. The analysis requires at least 30 days between start and end date to ensure meaningful segmentation.
- Tied spend values. Buyers with identical spend near a segment boundary may be assigned to adjacent segments.
- Overlapping segments. Top 5%, Top 10%, and Top Third are cumulative — a buyer in Top 5% is also counted in Top 10% and Top Third. Only the three thirds are mutually exclusive.
- Privacy threshold. Segments with fewer than 100 buyers return N/A for all metrics to protect individual buyer privacy. The segment row is still returned.
- Market scope. Analysis is limited to US market data.
- Revenue-based, not headcount-based. Segments reflect share of total revenue, not share of total buyers. A small number of high-spending buyers may represent a large revenue segment.