# Build a business metric definition knowledge base

A fictional three-file metric exercise: decide whether C-104 counts, inspect the dashboard draft, and keep the refund rule open.

## Task

Using only the three source files, define the weekly active-customer count, classify C-104, and review the dashboard draft. Preserve any unknowns and cite each conclusion with [[filename]].

## Expected reasoning

Under revision 1, C-104 counts because the customer was paid and not canceled at the Tuesday action; the Thursday cancellation does not remove that week. The draft incorrectly filters at week end, and refund handling remains unknown.

## Complete source packet

### Weekly active customer — revision 1 — weekly-active-customer-contract.md

```markdown
# Weekly active customer — revision 1
Owner: Growth Analytics
Window: Monday 00:00 through Sunday 23:59 UTC.

Count distinct customer_id values with at least one qualifying action during the window. At the action timestamp, the subscription must be paid and not canceled. Exclude a customer when cancellation is effective before the action timestamp; a cancellation after the action does not remove that week's activity. Exclude test accounts.

The contract does not specify how refund state changes this metric. Leave refund handling unknown.
```

### Qualifying customer actions — qualifying-actions.md

```markdown
# Qualifying customer actions

Count an event only when it has a customer_id and an event_at timestamp in UTC. The qualifying actions are: publish a reviewed knowledge page, complete a source review, or approve a revision for reuse.

Do not count a login, a page view, a failed import, or an event without customer_id. The action list does not define revenue, retention, or customer health.
```

### Existing dashboard query — draft — dashboard-query-draft.md

```markdown
# Existing dashboard query — draft
Status: owner approval pending
Window example: 2026-04-06 through 2026-04-12 UTC.

The draft counts distinct customer_id values with a qualifying action and a paid subscription, then filters out any customer whose cancellation_date is before the end of the week.

Example row: customer C-104 was paid and completed a qualifying action on Tuesday, then canceled on Thursday. The draft excludes C-104 because cancellation_date is inside the week. This query is a draft and is not an approved metric definition.
```

## Reference answer: count the action-time state, then flag the draft query

Under revision 1, C-104 counts because the customer was paid and not canceled at the Tuesday action; a Thursday cancellation does not remove that week's activity. The draft query incorrectly excludes any cancellation before week end and still needs owner approval. Refund handling is unspecified.

# Weekly active customer — reference

## Definition

Count distinct customer_id values with at least one qualifying action in the Monday-through-Sunday UTC window. A qualifying action is publishing a reviewed knowledge page, completing a source review, or approving a revision for reuse. Login, page view, failed import, and events without customer_id do not count. [[weekly-active-customer-contract.md]] [[qualifying-actions.md]]

At the action timestamp, the subscription must be paid and not canceled. A customer whose cancellation becomes effective after the action still counts for this revision of the metric. [[weekly-active-customer-contract.md]]

## C-104 and the draft query

C-104 counts in the example: the customer was paid and not canceled at the Tuesday qualifying action, while the Thursday cancellation happened afterward. The dashboard draft incorrectly removes C-104 by filtering cancellation_date at the end of the week. It is not an approved definition and needs the metric owner to reconcile its filter with the contract. [[weekly-active-customer-contract.md]] [[dashboard-query-draft.md]]

Refund handling is not specified by these sources. Keep it unknown rather than deciding whether a refund changes activity. [[weekly-active-customer-contract.md]]

## Changed source

### weekly-active-customer-contract.md

```markdown
# Weekly active customer — revision 2
Owner: Growth Analytics
Window: Monday 00:00 through Sunday 23:59 UTC.

Count distinct customer_id values with at least one qualifying action during the window. At the action timestamp, the subscription must be paid and not canceled. Exclude a customer when a cancellation becomes effective at any time during the window, even when the qualifying action happened before the cancellation. Exclude test accounts.

The contract does not specify how refund state changes this metric. Leave refund handling unknown.
```

## Expected change

The revision changes the cancelled-but-paid case: C-104 no longer counts because the cancellation became effective on Thursday inside the measurement window, even though the qualifying action was on Tuesday. The reference must replace its action-time-only conclusion and the draft query's end-of-week exclusion is now consistent with this revised contract, subject to owner approval. Qualifying actions and unknown refund handling are unchanged.

## Review boundary

Check the action-time paid and not-canceled rule against C-104, compare it with the draft's week-end filter, and leave refund handling unknown for the metric owner.

## Comparison

A single metric contract can be checked in ordinary files. A source-linked metric wiki helps when definitions, exclusions, draft queries, and later revisions must remain inspectable together without pretending that a formula has been approved.

## Read the localized page

https://wenlan.app/learn/build-business-metric-definition-knowledge-base
