Loading...
Loading...
Use when writing SQL queries, building analytics dashboards, tracking metrics, designing data pipelines, or analyzing user behavior and product usage
npx skill4agent add iankiku/forwward-teams data| Level | Metric | Cadence |
|---|---|---|
| North Star | 1 metric that defines success (e.g., WAU, MRR) | Weekly |
| Health | 3-5 metrics that predict north star (retention, activation, NPS) | Weekly |
| Feature | Per-feature usage, conversion, time-to-value | Per release |
| Debug | Granular events for troubleshooting | On-demand |
SELECT
DATE_TRUNC('week', u.created_at) AS cohort_week,
DATE_TRUNC('week', e.created_at) AS activity_week,
COUNT(DISTINCT e.user_id) AS active_users
FROM users u
JOIN events e ON e.user_id = u.id
GROUP BY 1, 2
ORDER BY 1, 2;WITH steps AS (
SELECT user_id,
MAX(CASE WHEN event = 'signup' THEN 1 END) AS step_1,
MAX(CASE WHEN event = 'onboard_complete' THEN 1 END) AS step_2,
MAX(CASE WHEN event = 'first_action' THEN 1 END) AS step_3,
MAX(CASE WHEN event = 'paid' THEN 1 END) AS step_4
FROM events
WHERE created_at > NOW() - INTERVAL '30 days'
GROUP BY user_id
)
SELECT
COUNT(*) AS total,
SUM(step_1) AS signup,
SUM(step_2) AS onboarded,
SUM(step_3) AS activated,
SUM(step_4) AS converted
FROM steps;SELECT
date,
value,
AVG(value) OVER (ORDER BY date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS rolling_7d
FROM daily_metrics;| Field | Example |
|---|---|
| |
| Authenticated user |
| Pre-auth (cookie/device) |
| ISO 8601, UTC always |
| |
noun_verbform_submittedfile_uploadedsubscription_cancelledclickevent1trackThismisc| Layer | Tool | Purpose |
|---|---|---|
| Collection | PostHog, Segment, or custom | Event ingestion |
| Storage | Postgres or BigQuery | Queryable warehouse |
| Transform | dbt or SQL views | Business logic layer |
| Visualization | Metabase, Grafana, or PostHog | Dashboards |