concept demographic datum in category churn

appears as: demographic data, demographic data
Fighting Churn with Data

This is an excerpt from Manning's book Fighting Churn with Data.

Figure 10.16 Accuracy comparison with demographic data

The SQL statement to extract demographic data along with all metrics for currently active customers is shown in listing 10.6. This is almost the same as similar listings in chapters 4 and 8 so I'll explain it only briefly. The main portion of the SQL is the aggregation to flatten the metrics just like before. The new feature is to join on the account table and also select the channel country and the date of birth. The date of birth is converted into a time interval representing the customer age in years (following the pattern used to create the historical dataset with demographic data presented earlier in this chapter).

Listing 10.6 Exporting metrics and demographic data for currently active customers
with metric_date as    #A
(
   select  max(metric_time) as last_metric_time from metric
),
account_tenures as (
   select account_id, metric_value as account_tenure
   from metric m inner join metric_date on metric_time =last_metric_time
   where metric_name_id = 8
   and metric_value >= 14
)
select s.account_id, d.last_metric_time as observation_date,
a.channel,    #B
a.country,    #C
date_part('day',d.last_metric_time::timestamp - a.date_of_birth::timestamp)::float/365.0 as customer_age,    #D
sum(case when metric_name_id=0 then metric_value else 0 end) as like_per_month,
sum(case when metric_name_id=1 then metric_value else 0 end) as newfriend_per_month,
sum(case when metric_name_id=2 then metric_value else 0 end) as post_per_month,
sum(case when metric_name_id=3 then metric_value else 0 end) as adview_per_month,
sum(case when metric_name_id=4 then metric_value else 0 end) as dislike_per_month,
sum(case when metric_name_id=34 then metric_value else 0 end) as unfriend_per_month,
sum(case when metric_name_id=6 then metric_value else 0 end) as message_per_month,
sum(case when metric_name_id=7 then metric_value else 0 end) as reply_per_month,
sum(case when metric_name_id=21 then metric_value else 0 end) as adview_per_post,
sum(case when metric_name_id=22 then metric_value else 0 end) as reply_per_message,
sum(case when metric_name_id=23 then metric_value else 0 end) as like_per_post,
sum(case when metric_name_id=24 then metric_value else 0 end) as post_per_message,
sum(case when metric_name_id=25 then metric_value else 0 end) as unfriend_per_newfriend,
sum(case when metric_name_id=27 then metric_value else 0 end) as dislike_pcnt,
sum(case when metric_name_id=30 then metric_value else 0 end) as newfriend_pcnt_chng,
sum(case when metric_name_id=31 then metric_value else 0 end) as days_since_newfriend
from metric m inner join metric_date on m.metric_time =d.last_metric_time
inner join account_tenures t on t.account_id = m.account_id
inner join subscription s on m.account_id=s.account_id
inner join account a on m.account_id = a.id    #E
where s.start_date <= d.last_metric_time
and (s.end_date >=d.last_metric_time or s.end_date is null)
group by s.account_id, d.last_metric_time, a.channel, a.country, a.date_of_birth    #F
order by s.account_id

Regarding the dataset for segmenting customers that your business colleague will use, it is important to realize that for the business people demographic data is not only important when it relates to churn and retention: For example, the marketing department we'll need to write different copy for engagement campaigns targeted to customers in different countries or regions. In a large organization the marketing department probably has access to all that kind of information through their own system, but I include everything here for completeness sake.