Analytics tutorials
Work through real analytics problems in FeatureQL — each page is a short, runnable walkthrough on a tiny dataset you can check by eye.
New to the language? Start with the FeatureQL SQL companion , then E-commerce for entities and relationships. Continue with SaaS or Supply before the advanced domain tutorials.
From SQL to FeatureQL
FeatureQL keeps physical data access separate from reusable business definitions:
- Declare business objects with
ENTITY()and typed keys withINPUT(TYPE#ENTITY). - Map source columns with
EXTERNAL_COLUMNS()and identify their entity key withBIND TO. - Persist reusable definitions with
CREATE FEATURES, or keep one-query expressions inWITH. - Load a persisted namespace with
FROM FM.*and supply concrete keys inFOR. - Use
RELATED()where SQL would join or aggregate across entities; useTRANSFORM()for SQL-like work inside an array of rows.
In generated notebooks, run setup, Data, and Model in order. If the kernel restarts or a later cell reports missing tables or features, rerun those sections before retrying the analytical query.
Recommended order
- E-commerce — entities, mappings, bindings, and relationship shapes.
- SaaS or Supply — persisted features and as-of inputs.
- Pick a domain tutorial. Finance, Marketing, Healthcare, Temporal, Graph, and OBT assume the earlier concepts.
Tutorials
| Tutorial | What you build |
|---|---|
| E-commerce | A retail model and the four RELATED() shapes, plus EXTEND() |
| SaaS metrics | Point-in-time MRR, segment breakout, and a reusable customer-health score |
| Supply inventory | Stock as of a date from signed events, then reorder and warehouse value |
| Financial consolidation | Per-entity revenue rules, a Europe rollup, and intercompany eliminations |
| Marketing attribution | First / last / linear credit, lookback, time decay, and channel weights |
| Healthcare episodes | Episode merge, 30-day readmission, and a corrected lab trend |
| Product analytics | Time-to-value, activation, retention, funnel, and rage-click detection |
| Temporal & experiments | Point-in-time segments, bi-temporal revenue, and a small A/B comparison |
| Graphs & referrals | Referral depth, subtree revenue, a NULL audit, and connected components |
| OBT modeling | Nested arrays on one account row — filter, argmax, and a profile ROW |
| Support operations | Ticket queues, SLA breaches, CSAT, escalations, and agent workload |
Concepts at a glance
Which pages touch which ideas:
| Concept | Ecomm | SaaS | Supply | Finance | Mkt | Health | Product | Temporal | Graph | OBT |
|---|---|---|---|---|---|---|---|---|---|---|
Entity mappings + RELATED() | x | x | x | x | x | x | x | x | ||
Array enrichment (EXTEND() / TRANSFORM()) | x | x | x | x | x | x | ||||
| Point-in-time / as-of measures | x | x | x | |||||||
| Event-sourced state | x | |||||||||
| Semi-additive inventory | x | |||||||||
| Cohort / retention-style metrics | x | x | ||||||||
| Composable health / scoring | x | |||||||||
| Variant / rule-driven metrics | x | |||||||||
| Non-additive rollup (elim) | x | |||||||||
| Attribution / credit models | x | |||||||||
| Lookback windows | x | |||||||||
| Time decay / weighted allocation | x | |||||||||
CARRY() into array transforms | x | |||||||||
| Interval / episode merge | x | |||||||||
| Readmission / lead-window flags | x | |||||||||
| Lab trends (corrected values) | x | |||||||||
| Time-to-value / activation | x | |||||||||
| Day-N retention | x | |||||||||
| Engagement tiers | x | |||||||||
| Conversion funnel | x | |||||||||
| Rage-click / friction windows | x | |||||||||
SCD2 / SCD_AT_TIME() | x | |||||||||
| Bi-temporal knowledge dates | x | |||||||||
| A/B rates + confidence intervals | x | |||||||||
RECURSE() / referral depth | x | |||||||||
| Subtree / hierarchy rollup | x | |||||||||
| Connected components | x | |||||||||
| NULL group-by audit | x | |||||||||
Nested ARRAY(ROW) / OBT | x | |||||||||
| Array argmax / nested line items | x | |||||||||
Re-nested profile ROWs | x | |||||||||
| Persisted feature libraries | x | x | x | x | x | x | x | x |
Serving the same features: Real-time segmentation and Federated serving . Shorter product walkthroughs: Homepage .