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:

  1. Declare business objects with ENTITY() and typed keys with INPUT(TYPE#ENTITY).
  2. Map source columns with EXTERNAL_COLUMNS() and identify their entity key with BIND TO.
  3. Persist reusable definitions with CREATE FEATURES, or keep one-query expressions in WITH.
  4. Load a persisted namespace with FROM FM.* and supply concrete keys in FOR.
  5. Use RELATED() where SQL would join or aggregate across entities; use TRANSFORM() 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

  1. E-commerce — entities, mappings, bindings, and relationship shapes.
  2. SaaS or Supply — persisted features and as-of inputs.
  3. Pick a domain tutorial. Finance, Marketing, Healthcare, Temporal, Graph, and OBT assume the earlier concepts.

Tutorials

TutorialWhat 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:

ConceptEcommSaaSSupplyFinanceMktHealthProductTemporalGraphOBT
Entity mappings + RELATED()xxxxxxxx
Array enrichment (EXTEND() / TRANSFORM())xxxxxx
Point-in-time / as-of measuresxxx
Event-sourced statex
Semi-additive inventoryx
Cohort / retention-style metricsxx
Composable health / scoringx
Variant / rule-driven metricsx
Non-additive rollup (elim)x
Attribution / credit modelsx
Lookback windowsx
Time decay / weighted allocationx
CARRY() into array transformsx
Interval / episode mergex
Readmission / lead-window flagsx
Lab trends (corrected values)x
Time-to-value / activationx
Day-N retentionx
Engagement tiersx
Conversion funnelx
Rage-click / friction windowsx
SCD2 / SCD_AT_TIME()x
Bi-temporal knowledge datesx
A/B rates + confidence intervalsx
RECURSE() / referral depthx
Subtree / hierarchy rollupx
Connected componentsx
NULL group-by auditx
Nested ARRAY(ROW) / OBTx
Array argmax / nested line itemsx
Re-nested profile ROWsx
Persisted feature librariesxxxxxxxx

Serving the same features: Real-time segmentation and Federated serving . Shorter product walkthroughs: Homepage .