Skip to main content

Segmentation

Segmentation is a powerful and flexible tool for visualizing trends and compositions in your data. You can analyze events, cohorts, and user profiles, and display the results in various chart types.

Advanced segmentation features let you add calculations and compare current and past data.

image

Use cases​

Here are some sample questions you can answer with segmentation:

  1. High-level product analytics

    1. How is my WAU (weekly active users count) changing over time?
    2. How often are my users getting value?
    3. What is the distribution of my users across regions, devices, etc.? (property breakdown)
  2. B2B (in this case, a messaging application)

    1. How many messages were sent in the US in the past 30 days?
    2. How many users had a mobile app session yesterday? (unique events)
    3. How many messages are sent per session? (calculations)
    4. How much revenue was generated on plans purchased in the past year? (property aggregation)
    5. How has the power users cohort grown over the past 6 months? (cohort trends)
  3. Marketing

    1. Which advertising campaigns generate the most checkouts? (property breakdown)
    2. Which advertising campaigns generate the most revenue? (property aggregation)
  4. Revenue analytics

    1. Show me the change in MRR from our US-based customers over the last year.
    2. What is our current MRR?

Segmentation basics​

You have already learned the basics of segments in Mitzu. This section covers the most essential segment concepts for user (or any other entity) segmentation.

Segmentation analysis​

Segmentation analysis finds behavioral patterns in your user (or other entity) data. In Mitzu, segmentation focuses on comparing the behavior of different segments of users (or other entities) and identifying the differences between them.

Examples of segmentation analysis​

Let's look at some examples of segmentation analysis:

note

I want to compare the number of users who visited our website with the number who checked out during one month.

This can be done by simply creating two user segments in the segments panel (left side of the page). For the first segment, we choose users who performed the Page Visit event. For the second segment, we select users who performed the Checkout event. Both segment definitions will be decorated with the Count uniques aggregation. This means we will count the unique users in each segment, since Analyze by is set to User. We will set the date range to December 2021 and use the Daily trend measurement type. Finally, we will visualize this as a line chart.

image
note

Let's take this a step further and calculate the ratio between the two segments.

You can do this by clicking + Calculation under Applies to all series, below the segments. The expression should be A / B, where A refers to the first segment and B refers to the second segment.

image

As you can see, on most days there are between 5 and 10 visitors for every user who checks out, with a few days reaching 20. However, I want to see the big picture. Let's zoom out and see how this measurement has changed over six months. To do this, I need to change the date range to July–December 2021 and use the weekly trend measurement type.

image

As you can see, the weekly ratio stays between 4 and 7 visitors per checkout for most of the period, but it jumps to 9 at the start of November. This is something we should investigate further. In practice, to investigate further, I would switch to funnel analysis and see which marketing campaigns drove the most traffic to our website, and which had the highest conversion rate to checkout.

For now, I will stop here. This example was intended to show you what an investigation looks like in Mitzu.

Segmentation features​

In this section, we will cover the features that extend the basics of Mitzu insights. Segmentation is a special insight type because you can select multiple segments of users for comparison. You can also choose how you measure the segments.

Segment measures​

Each segment has a grey Measure block under its breakdowns. Pick a measure at the top of the block, and the settings it needs appear inside the block, right under it. Measures without settings, such as Unique users, are a single row. By default, the measure is Unique users, which means we count the number of unique users in each segment.

image

The Measure list has two groups:

  • Unique users - the users who did the event.
  • Event totals - every time the event happened.
  • Average events per user - event totals divided by unique users.
  • Frequency per user - how many times each user did the event.
  • Aggregate property - sum, average, median or percentiles of a property across events.
  • Aggregate property per user - a value for each user, such as their sum of a property, then the median, a percentile or another aggregation across users.
info

If Analyze by is set to Group, Mitzu counts the number of groups in each segment. If Analyze by is set to anything else, such as the session_id property, the first measure is called Uniques and counts the number of unique sessions in each segment.

Event totals​

This measure counts the number of events in the segment.

image

In the example above, two segment definitions were defined with the same event, Page Visit. The blue line shows the number of events performed by the segment's users, while the green line shows the number of unique users in the segment.

Average events per user​

Average events per user divides the number of events in the segment by the number of unique entities (users by default). It answers questions like "How many events does each unique user perform on average?" without forcing you to add a calculation.

info

This is equivalent to the calculation A / B, where A is the same segment with Event totals and B is the same segment with Unique users. Use Average events per user when you want one segment instead of two.

Frequency per user​

Frequency per user looks at how many times each user did the event in the date range. Pick an aggregation in the field under the measure:

  • Distribution (the default) - one bar per number of times: the users who did the event once, twice, three times and so on. Each user is in exactly one bar.
  • Average - the average number of times per user, the same number as Average events per user.
note

How often do our users check out? How many checked out only once, and how many came back for more?

Pick Frequency per user on a Checkout segment. The chart shows one bar per number of checkouts. Use the buckets field next to the aggregation to group the counts, for example into 1, 2 and ≥ 3. Click a bar to filter on those users, create a cohort from them or list them, as with any other bar.

Aggregate property​

This measure aggregates the property values of the segment.

  1. First, choose the aggregation function. Currently, we support the following aggregation functions:
    1. Count distinct
    2. Sum
    3. Average
    4. Minimum
    5. Maximum
    6. Median
    7. P75
    8. P90
    9. P95
    10. P99

Except for the Count distinct aggregation function, the aggregation functions only work with numeric properties.

note

How many different marketing campaigns did we run in the last 60 days?

This question can be answered by choosing the Count distinct aggregation function and selecting the Campaign property. This counts the number of distinct campaigns for which at least one page visit occurred.

Aggregate property per user​

Aggregate property per user works in two steps: it first works out one value for each user, then combines those values across users. Pick the property in the block, then the two steps:

  • Per user (next to the property) decides each user's value from their events:
    • Sum, Average, Minimum or Maximum of the property. These need a number property. Like Aggregate property, the list shows every property, and a property that isn't a number shows an error when the chart runs.
    • Distinct values counts how many different values of the property each user had. It works with any property.
  • Aggregation type (under the property) decides how the users' values are combined: Distribution, Average, Median, P75, P90, P95, P99, Minimum or Maximum. Distribution counts users by their value instead of combining them:
    • With Distinct values, it draws one bar per count: the users who had 1 value, 2 values and so on.
    • With Sum, Average, Minimum or Maximum, it draws one bar per range of the value, for example the users whose total is between 0 and 500. The ranges are worked out from the data; set their size, count or limits in the field next to Distribution. Switch Bucket values off in that field to draw one bar per exact value instead; the field then reads No bucketing.
    • Users with no value for the property are in the <n/a> bar.

Hover the info icon next to Aggregate property per user to see the calculation spelled out, for example "Average of sums of Amount per user".

note

What is the median amount a paying user spent last year, and how much do the top 10% spend?

Pick Aggregate property per user on an Invoice paid segment, the Amount property, Sum per user and Median as the aggregation type. Each user's invoices are added up first, and the chart shows the median of those totals. Change the aggregation type to P90 to see the total that the top 10% of payers reach. Aggregate property with Median answers a different question: the median size of a single invoice.

  • Each user's value is worked out within each point of a trend: on a weekly trend, every week adds up each user's invoices of that week again. On an Overall chart, it covers the whole date range, and with a comparison, each window separately.
  • With a breakdown, each breakdown value gets its own result, worked out from the users' events with that value.
  • Users with no value for the property are left out, so they don't pull the average or the median towards zero.
  • Except for Distribution, the result is a single number per point, so it can share a chart with any other measure. It can't have a rolling window, and the segment's breakdown dropdown doesn't offer Frequency or Distinct values.

For example, pick the Device class property, Distinct values and Distribution on a Page Visit segment to see how many visitors used one device class and how many used several, or Average to see how many device classes a visitor used on average. Pick the Amount property, Sum and Distribution on an Invoice paid segment to see how many payers spent up to 500, 500 to 1,000 and so on. Clicking a bar of a Sum, Average, Minimum or Maximum distribution doesn't offer drill-downs yet.

Distributions​

Frequency per user and Aggregate property per user with the Distribution aggregation type follow the same rules as the time to convert distribution in funnels:

  • The dropdown next to the date range shows Distribution as its only option, because each user is counted once over the whole date range. To see a trend, pick a different measure or aggregation type first.
  • The chart is a bar chart, and comparison is off.
  • The segment's breakdown dropdown doesn't offer Frequency or Distinct values, because the measure already uses them. You can still break the distribution down by other properties.

A distribution can't share a chart with other measures. If one segment is a distribution and another isn't, the chart says These measures can't share a chart and names the segment to change: change it to a distribution too, or remove it.

info

Insights saved before these measures existed keep working as they were. A segment with Unique users and a Frequency or Distinct values breakdown still shows them as a breakdown, and both breakdowns stay available with every other measure.

Rolling window​

A rolling window makes every point of a trend count a trailing window instead of only its own day, week or month. With Count uniques and a 30-day window on a daily trend, each day shows the users who did the event in the 30 days ending on that day: monthly active users, day by day.

To add one, open the segment's ⋯ menu and choose Rolling window. In the dialog, set the length and the unit (days, weeks or months), then click Apply. The window starts at 30 days on a daily trend, 4 weeks on a weekly trend and 3 months on a monthly trend, and switching the unit resets the length to that unit's default.

image

The segment header then shows a Rolling window tag, next to the segment's ⋯ menu. Click the tag to change the window in the same dialog, or click its × to go back to counting each point on its own.

image

The window works with every aggregation type:

  • Count uniques counts each user once per window, however many days they were active in it.
  • Count event totals counts every event in the window.
  • Aggregate property and Average are calculated over every event in the window.
  • Aggregate property per user doesn't take a rolling window.

The trend granularity decides how many points the chart has, and the window decides how far back each point looks. On a weekly trend with a 30-day window, each week shows the 30 days up to the end of that week. The first points read events from before the start of the date range, so they cover a full window too.

A rolling window works on daily, weekly and monthly trends. It can't be shorter than one point, for example 3 days on a weekly trend, and it can be at most a year long. It isn't available on an Overall chart.

tip

DAU/MAU stickiness is a calculation over two segments of the same event: A without a rolling window (daily users) and B with a 30-day window (monthly users). Add the calculation %:A/B to chart the share of the month's users who were active on each day.

A rolling window is different from a rolling average: the rolling average smooths the points after they are counted, so a user active on several days is counted on each of them. The rolling window counts the window in your data warehouse.

Metrics​

A segment does not have to be a single event. It can also be a saved insight, usually a funnel, reused as a segment. This is how you compare two funnels on one chart, or show a conversion rate next to the volume behind it. See Saved insights as series.

A segment can also be a warehouse metric: a number your data team calculates in the warehouse, such as revenue or MRR, charted next to your event metrics. See Warehouse metrics.

Calculations​

A calculation is a formula over the segments of the insight, shown as its own series. The most common use is a rate: the number of events per user, or the share of one segment in another.

image

In the example, the calculation B / A shows the number of page visits per user per week as a trend.

Adding a calculation​

Click + Calculation under Applies to all series, below the segments. A calculation has a name and a formula expression. The name is what the chart legend, the tooltips and the table show; leave it empty and they show the expression instead. Use + Calculation again for a second one, so one insight can carry several derived numbers, for example a conversion rate next to an average order value. With more than one calculation, each label starts with the calculation's number (1. Conversion rate, 2. Average order value), the same way segments start with their letter, so two calculations with the same name still show as separate series.

The ⋮ menu of a calculation offers Duplicate and Remove.

Formulas support the following algebraic operations:

  1. + addition
  2. - subtraction
  3. * multiplication
  4. / division

Mitzu also supports parentheses () in these expressions.

Letters refer to segment definitions, for example:

  • A - the first segment
  • B - the second segment
  • ... and so on ...
tip

To show a calculation as a percentage, prefix the expression with %: — for example %:A/B. This multiplies the result by 100 and adds a % sign to the chart axis, tooltips, and tables. (Writing (A * 100) / B also scales the value, but without the % sign.)

Calculations are best for ratios of independent metrics. When one action only happens after or because of another, use a funnel instead — a funnel's conversion rate joins on the same user and stays within 0–100%.

Adding the first calculation hides every segment and shows only the results. The segments are still part of the insight: each one has a hide/show toggle in its menu, so you can show a segment again and see its own numbers next to the calculations. That is how one insight holds a percentage and a plain count side by side. Removing the last calculation shows every segment again.

Calculation breakdowns​

If you are using a calculation and want to break down your results by a property, the exact same property must be used in each segment definition referenced in the expression.

note

What is the average number of page visits per user, broken down by the Acquisition Campaign property?

image

Post-processing​

Post-processing options are only available in segmentation analysis. These operations are not performed in SQL in your data warehouse, but in the Mitzu backend on the result dataset.

Currently, we support these post-processing operations:

  1. Rolling average with various window sizes
  2. Cumulative sum

Rolling averages​

Post-processing with rolling averages is useful for "smoothing" your result charts.

Choose a rolling average in the post-processing dropdown of the toolbar. It offers presets for each trend granularity, measured in the same units as the chart:

  • Daily trends: windows of 3, 7, 14 and 21 days.
  • Weekly trends: windows of 2, 4, 8 and 16 weeks.
  • Monthly trends: windows of 2, 3, 6 and 12 months.
  • Yearly trends: windows of 2, 3, 5 and 10 years.
  • Hourly trends: windows of 2, 4, 6 and 12 hours.

For any other size, choose Custom… and enter a window size from 2 to 1,000. The window is counted in the chart's trend granularity: a window of 7 on a daily trend averages each point with the six days before it. The first points average the periods available so far. Each series is smoothed on its own.

Rolling averages are not offered on an Overall chart, where the dropdown is hidden.

To count the users of a trailing window, such as monthly active users day by day, use a rolling window on the segment instead.

image

Without post-processing, the chart looks like this:

image

With post-processing, the chart looks like this:

image

The overall trend is easier to read with post-processing.

Cumulative sum​

Cumulative sum helps you calculate the running total of any measurement. For example, how many total visits happened over the last 6 months?

image

Forecasting​

When a trend granularity is selected, segmentation insights support Forecast from the More menu. This is most useful for monitoring metrics where you care about the upcoming trajectory (DAUs, weekly signups, MRR).

info

Segmentation insights support User sampling (under Advanced), which reads a share of your users and scales the counts back up to full-population estimates. Resolution is not offered, because a segmentation counts every event of the users it reads. Whether a new segmentation starts out sampled depends on the workspace's Apply entity sampling to setting. See Data sampling and resolution.

Comparison​

The Comparison feature lets you analyze data trends by comparing them against those from a previous time period. For example, you can compare data points from the last month with those from the month before.

To use this feature:

  1. Select the desired comparison window from the dropdown menu.
  2. Choose a comparison method by selecting the appropriate icon next to the dropdown.

In segmentation, comparison can be performed using either of the following methods:

image

The dropdown offers No comparison, Custom… and, below the divider, the presets that fit the chart's time grouping: Previous period, Previous day, Previous week, Previous month and Previous year. Previous period is the window straight before the selected range, as long as the range itself — six months on a six month range, nine weeks on a nine week weekly trend. It is left out when another preset already lands on the same dates.

Custom comparison​

Custom… opens a window with two modes:

  • Relative compares against a fixed distance back, for example 6 Weeks ago. The distance stays the same when the date range changes.
  • Specific date compares against the period that starts on the date you pick, and is as long as the selected range. It shows up in the dropdown as From 2025-06-01. Above the date picker the window shows the insight's own date range, and below it the exact dates the chart will compare against.

On a weekly, monthly, quarterly or yearly trend the earlier period starts with the calendar week, month, quarter or year that contains the picked date, and each bucket is drawn beside the bucket at the same position. Pick 2025-06-04 on a weekly trend and the first week of the range is compared with the week of June 2. The dates named in the window, in the dropdown tooltip and above the chart are the selected range shifted back, so both periods read as the same length; the hint under the date picker adds where the first week, month, quarter or year actually starts counting.

The picked date has to leave room for an earlier period: on a trend it has to fall before the range's first bucket, and on an overall chart the whole earlier period has to end before the range starts. If you later change the date range so that the date no longer fits, the dropdown keeps it selected but the chart shows no comparison. Hover the option to see why.

A specific date stays fixed when the date range moves, so on a rolling range, such as the last 30 days, the distance between the two periods grows every day. The same happens on a dashboard whose date filter replaces the insight's own range.

Comparison with absolute values​

When comparing with absolute values, the system displays both:

  • the data points from the selected insight time window, and
  • the data points offset by the chosen comparison time period.

Both trends are visualized together on the same chart, making it easy to identify similarities or differences between the two time windows.

image

Comparison with percentage values​

When comparing with percentage values, the system calculates the percentage difference between each data point and its corresponding value at the comparison time offset.

The result is displayed as a single trend line representing percentage changes over time, making it easy to observe relative growth or decline.

image

Comparison on overall charts​

Comparison also works when the insight is set to Overall instead of a trend, which covers the two charts most often pinned to a dashboard: the big number and the bar chart.

Whichever chart it is, the window being compared against is named in the chart's own date indicator rather than on the chart, on the same line as the range the chart covers: 2025-02-01 — 2025-03-01 vs. 2025-01-01 — 2025-02-01 on the insight page, and Daily, Feb 01 - Mar 01 vs. Jan 01 - Feb 01 in a dashboard card's header.

  • A big number lays every segment out as a cell in a grid, separated by hairlines and ordered by value, largest first — or alphabetically, when Order by breakdown labels is on in the chart's ⋮ menu. Each cell is centred and reads as three lines: the segment's key, its value, and the change. The change is a chip carrying a direction glyph and an unsigned magnitude — ▼ 62 — with the previous period's own value beside it as from 657. The chip follows the # / % choice above: # shows the absolute difference and % the relative change, and the previous value is shown either way. When the previous period is zero, no percentage is shown, because a change from zero has no meaningful percentage. A segment the previous window returned nothing for still shows its value, with a neutral no prior period chip. At most ten segments are shown; a wider breakdown counts the rest below the grid as +5 other segments. Clicking a cell opens the same actions menu a bar or a pie slice does — see trends, filter on the value, create a cohort.
  • A bar chart draws the previous period as a second bar next to each current bar. With a breakdown applied, every value keeps its own pair side by side, and the previous bar is a faded version of the colour its counterpart uses.

The indicator is coloured by direction: green for an increase, red for a decrease and grey when nothing moved, in shades that stay legible in both light and dark mode.

caution

The colour reflects the direction of the number, not whether the change is good. On a metric where falling is the goal — churn, error rate, time to value — a green indicator still means the number went up.

info

On an overall chart the offered comparison windows are only those at least as long as the selected date range, so the two periods never overlap. A six month range offers Previous period and Previous year; a seven day range also offers Previous month. This differs from trends, where the window has to line up with the chart's time buckets instead.

info

Previous year compares a custom or calendar date range against the same dates a year earlier. A rolling range, such as the last 30 days, goes back 52 weeks instead, so every weekday is compared against the same weekday. An overall chart over a rolling year or longer goes back a calendar year, because 52 weeks would overlap it. A weekly trend always goes back 52 weeks, which keeps its weeks aligned. Hover any option in the comparison dropdown to see how far back it goes and the exact dates it compares against.

On a daily chart, each day is compared with the same calendar date. A date that has no counterpart in the earlier period, such as February 29, gets no previous point.

  • A pivot table gives the previous period its own row directly under the row it belongs to, labelled for example free (previous). Its column dropdown can put the two periods side by side instead, as a current and a previous column under each event — see Pivot tables.

Pie charts, country maps and the stacked charts do not offer comparison. Each of them draws a single whole, and a second period has nowhere to sit in it: a stack would either inflate its own total or, on the percentage variants, rebase every share.

Video tutorial​