When would you use this?
- You want to know how many customers bought today, this week, and this month - and whether that number is growing.
- Your marketing team runs a loyalty campaign and wants to track weekly engagement lift over the following month.
- Leadership asks “Are our regulars becoming more or less frequent?” - you need a stickiness ratio to answer that.
- You are building a retention dashboard and need each data point to show the active user count for its own period, not a snapshot of today.
What this recipe builds
Four metrics - DAU, WAU, MAU, and a WAU/MAU stickiness ratio. Each metric usesTIME_METRIC with a different grain, so each date on the time spine
shows the active customer count for its own window: a daily count for DAU, a
rolling week for WAU, a rolling month for MAU.
The stickiness ratio divides WAU by MAU - a high value means customers are
ordering frequently, not just once a month. All four metrics are sliceable
by city, truck, menu type, or any other dimension.
Prerequisites
Adate entity must be marked as a time spine.
Steps
1
Daily Active Users
Distinct customers per day. Each date point on the time spine shows the count for
that specific day only.
- SQL
- YAML
2
Weekly Active Users
Distinct customers per calendar week. Constant within Mon–Sun, then updates at the
week boundary.
- SQL
- YAML
3
Monthly Active Users
Distinct customers per calendar month. Stays constant for the whole month - the
denominator for the stickiness ratio.
- SQL
- YAML
4
WAU to MAU ratio
What fraction of monthly customers also ordered this week? High values indicate
frequent visitors; low values indicate mostly one-time monthly buyers.
- SQL
- YAML
Sample output
First week of June 2022:
On June 6, a new calendar week starts - WAU jumps from 97,559 to 100,468 and the
stickiness ratio updates accordingly.
Key design notes
Related reading
- Time metrics - reference for
TIME_METRIC - Time spines - how to mark an entity as a time spine
- Year-over-year growth - another recipe using
TIME_METRIC, with theoffsetargument