The churn view: leads, upgrades, downgrades and renewals per day in one UNION
At a glance
Does
Unions four counts per site, source and calendar day: new users as leads, downgrades, upgrades and renewals. Exposes day, month, site, source and four sums.Trust: Source-defined
Why
A subscription movement report. The enterprise model labels its explore Churn Report, for tracking upgrades against downgrades by acquisition source.Trust: Inferred
1- view:churn2derived_table:3sql: |4SELECT site, source, calendar_date,5SUM(upgrades) AS upgrades,6SUM(downgrades) AS downgrades,7SUM(leads) AS leads,8SUM(renewals) AS renewals9FROM (10SELECT U.site,11 U.source,12TRUNC(U.created_at) AS calendar_date,13COUNT(1) AS leads,
Every field as declared, with the dashboard tiles that read it. Computed from the source; nothing here is edited.
Derived table: persists for 1 hour. Reads warehouse tables directly.
Dimensions 4
Name
Type
SQL
Used by
Tags
dayL73
date
${TABLE}.calendar_date
-
monthL76
date_month
${TABLE}.calendar_date
-
siteL79
string
${TABLE}.site
-
sourceL81
string
${TABLE}.source
-
Measures 4
Name
Type
SQL
Used by
Tags
leadsL83
sum
${TABLE}.leads
-
downgradesL87
sum
${TABLE}.downgrades
-
renewalsL91
sum
${TABLE}.renewals
-
upgradesL95
sum
${TABLE}.upgrades
-
Relationships
Trust: Source-defined
No joins, no upstream views and no dashboard tiles reference this view. It is an island in the model.
Relationships of churn
This Block
Text version
churn is the base view of churn: base view
Filters and exclusions that change meaning
A downgrade is an auto-renew-off subscription past its renewal date
Trust: Source-defined
The downgrade branch counts subscriptions with auto_renew = false and next_renewal_on before today, dated on the renewal day. Cancellations with time left are not counted yet.
6SUM(downgrades) AS downgrades,7SUM(leads) AS leads,8SUM(renewals) AS renewals9FROM (10SELECT U.site,11 U.source,12TRUNC(U.created_at) AS calendar_date,13COUNT(1) AS leads,140AS downgrades,150AS upgrades,160AS renewals17FROM users U18GROUPBY U.site,19 U.source,20trunc(U.created_at)21UNIONALL22SELECT U.site,23 U.source,24TRUNC(S.next_renewal_on) AS calendar_date,250,26COUNT(1) AS downgrades,270,280AS renewals29FROM subscriptions S30JOIN users U ON S.user_id = U.id
Blocker: Downgrades multiply by upgrade transactions
Trust: Source-defined
The downgrade branch joins user_transactions on user_id with T.type = 'upgrade'. A user with three upgrade transactions adds three downgrades for one subscription.
What goes wrong:downgrades overstates churn for the most engaged upgraders, and net movement looks worse than it is.
The derived table selects from users, subscriptions and user_transactions directly. users and user_transactions are referenced as LookML views elsewhere but are not in the repo.