Typeform model

Score summary

NPS, average score and top-two-box (CSAT-style) per scale question per month.

Grain
month x typeform_account x form x question
Built from
  1. 5
    Raw tables
  2. 5
    Staging
  3. 1
    Core
  4. 1
    Analytics
Reads from Typeform
formform_fieldform_field_propertyresponseresponse_answer
Ships as
Weld and dbt SQL, open source on GitHub
core.typeform.score_summary
1-- core.typeform.score_summary
2-- NPS, average score and top-two-box (CSAT-style) per scale question per month.
3-- Grain: month x typeform_account x form x question. Months are UTC calendar
4-- months of `submitted_at`. Only questions of type nps, opinion_scale and rating.
5-- Depends on: staging.typeform.response_answer, .response, .form_field,
6--             .form_field_property, .form
7--
8-- NPS is computed from counts: share of promoters (9 to 10) minus share of
9-- detractors (0 to 6), times 100. The counts are returned too, so a quarter or a
10-- year is rolled up by summing the counts and recomputing, never by averaging the
11-- monthly NPS values. Averaging monthly NPS weights a month with five answers the
12-- same as a month with five hundred.
13--
14-- NPS is only returned for Typeform's dedicated NPS question type, which is always
15-- 0 to 10. An opinion scale someone set up as 0 to 10 is not treated as NPS: use
16-- Typeform's NPS question if you want the classification.
17--
18-- TOP TWO BOX: share of answers in the top two points of the scale, the usual
19-- CSAT definition (4 or 5 on a five-point scale). The top of the scale is read
20-- from the question's own settings: `steps` for a rating, and `steps` plus
21-- `start_at_one` for an opinion scale (which runs 0 to steps-1, or 1 to steps).
22-- When the setting is missing the rate is NULL rather than guessed.
23
24WITH scale_fields AS (
25    SELECT
26        q.typeform_account,
27        q.form_id,
28        q.field_id,
29        q.field_title,
30        q.field_type,
31        SAFE_CAST(MAX(IF(p.property_key = 'steps', p.property_value, NULL)) AS INT64) AS steps,
32        LOGICAL_OR(p.property_key = 'start_at_one' AND LOWER(p.property_value) = 'true') AS starts_at_one
33    FROM {{staging.typeform.form_field}} q
34    LEFT JOIN {{staging.typeform.form_field_property}} p
35           ON p.typeform_account = q.typeform_account
36          AND p.form_id          = q.form_id
37          AND p.field_id         = q.field_id
38    WHERE q.field_type IN ('nps', 'opinion_scale', 'rating')
39    GROUP BY 1, 2, 3, 4, 5
40),

This model and the 6 it depends on. Deploy them together; refs like {{staging.…}} resolve to the matching folders in Weld, and the dbt view uses source() and ref().

Notes

How it counts. And where it stops.

NPS is computed from counts: share of promoters (9 to 10) minus share of detractors (0 to 6), times 100. The counts are returned too, so a quarter or a year is rolled up by summing the counts and recomputing, never by averaging the monthly NPS values. Averaging monthly NPS weights a month with five answers the same as a month with five hundred. NPS is only returned for Typeform's dedicated NPS question type, which is always 0 to 10. An opinion scale someone set up as 0 to 10 is not treated as NPS: use Typeform's NPS question if you want the classification. TOP TWO BOX: share of answers in the top two points of the scale, the usual CSAT definition (4 or 5 on a five-point scale). The top of the scale is read from the question's own settings: `steps` for a rating, and `steps` plus `start_at_one` for an opinion scale (which runs 0 to steps-1, or 1 to steps). When the setting is missing the rate is NULL rather than guessed.

Raw tables it reads

  • raw.typeform.form
  • raw.typeform.form_field
  • raw.typeform.form_field_property
  • raw.typeform.response
  • raw.typeform.response_answer

Put Typeform in front
of your agents.

Connect Typeform, deploy the models, and ask questions in Claude, Cursor or ChatGPT. Free for 14 days, no credit card.