Skip to content
OrionStats
Module 10 · HR Analytics · People analytics

Marketing, sales and HR analytics in practice

Apply analytics to customer segmentation, sales productivity and the workforce — attrition, performance, recruitment and productivity — responsibly.

Intermediate70 min
Learning objectives
  • Segment customers with rule-based and data-driven approaches
  • Measure sales productivity and employee performance fairly
  • Compute headcount, attrition and recruitment funnel metrics correctly
  • Handle people data ethically and legally

Customer segmentation

Approach Example Strength
Demographic / firmographic Age band, city, company size Simple, explainable
Behavioural RFM, channel preference, category mix Predicts behaviour
Value-based CLV tiers Aligns spend with value
Needs-based Survey-derived Informs product design
Data-driven clustering k-means on behaviour features Finds non-obvious groups — must still be explainable and actionable

Good segments are measurable, sizeable, reachable, distinct and actionable.

Sales performance and productivity

Rep productivity = output ÷ input (revenue per rep, deals per 100 calls, revenue per hour). Compare like with like — territory potential, tenure and lead quality differ. Attainment vs plan corrects partly for territory size, if plans are fair.

SELECT e.job_level,
       COUNT(DISTINCT sp.employee_id) AS reps,
       ROUND(AVG(sp.sales_actual / sp.sales_plan) * 100, 1) AS avg_attainment_pct,
       ROUND(1.0 * SUM(sp.deals_closed) / SUM(sp.calls_made) * 100, 1) AS deals_per_100_calls
FROM sales_performance sp JOIN employees e ON e.employee_id = sp.employee_id
WHERE sp.year_month LIKE '2025%'
GROUP BY e.job_level ORDER BY avg_attainment_pct DESC;
Result · 5 rows
job_levelrepsavg_attainment_pctdeals_per_100_calls
Senior17110.225.7
Mid19109.324.1
Lead15107.925
Manager9107.824.9
Junior34106.624

HR analytics: workforce and attrition

Metric Formula
Headcount (point in time) Employees employed on a date
Average headcount (start + end) ÷ 2, or average of monthly headcounts
Attrition rate (annual) Leavers in year ÷ average headcount in year
Voluntary attrition Resignations ÷ average headcount
Early attrition Leavers within 12 months of hire ÷ hires
Time to fill Requisition opened → offer accepted (days)
Offer acceptance Offers accepted ÷ offers made
WITH hc AS (
  SELECT
    SUM(hire_date <= '2025-01-01' AND (exit_date IS NULL OR exit_date > '2025-01-01')) AS start_hc,
    SUM(hire_date <= '2025-12-31' AND (exit_date IS NULL OR exit_date > '2025-12-31')) AS end_hc,
    SUM(exit_date BETWEEN '2025-01-01' AND '2025-12-31') AS leavers_2025
  FROM employees)
SELECT start_hc, end_hc, leavers_2025,
       ROUND(100.0 * leavers_2025 / ((start_hc + end_hc) / 2.0), 1) AS attrition_pct
FROM hc;
Result · 1 row
start_hcend_hcleavers_2025attrition_pct
3803377922

Drivers by department:

SELECT d.department_name,
       SUM(e.exit_date BETWEEN '2024-01-01' AND '2025-12-31') AS leavers_24_25,
       COUNT(*) AS ever_employed,
       ROUND(AVG(CASE WHEN e.exit_date IS NOT NULL THEN e.last_rating END), 2) AS avg_rating_leavers,
       ROUND(AVG(CASE WHEN e.exit_date IS NULL THEN e.last_rating END), 2) AS avg_rating_stayers
FROM employees e JOIN departments d ON d.department_id = e.department_id
GROUP BY d.department_name ORDER BY leavers_24_25 DESC;
Result · 8 rows
department_nameleavers_24_25ever_employedavg_rating_leaversavg_rating_stayers
Sales441743.073.29
Customer Service421593.063.4
Operations241303.263.36
IT13653.073.24
Marketing9503.113.32
Data & Analytics8313.063.54
Finance7432.953.17
HR4263.53.5

Interpretation. High-volume departments (Sales, Customer Service) lose the most people; leavers have lower average ratings — consistent with both voluntary exits of disengaged staff and dismissals. Separate voluntary from involuntary before concluding.

Employee performance analytics

Ratings are subjective and manager-dependent; compare distributions across managers (calibration), combine with objective outcomes where they exist (sales attainment), and beware of using one metric to rank people with different roles.

Recruitment metrics

SELECT source, COUNT(*) AS candidates,
       SUM(furthest_stage = 'hired') AS hired,
       ROUND(100.0 * AVG(furthest_stage = 'hired'), 1) AS hire_rate_pct
FROM recruitment GROUP BY source ORDER BY hire_rate_pct DESC;
Result · 5 rows
sourcecandidateshiredhire_rate_pct
career_site886485.4
linkedin856435
job_board857394.6
referral895384.2
agency916333.6

Ethics and privacy in people analytics

  • Use aggregates; suppress groups smaller than ~5 people so individuals cannot be identified.
  • Restrict access to HR data; log access.
  • Don't build models that decide about individuals (e.g. "flight risk" scores) without legal review, transparency and human oversight; check for bias across protected characteristics.
  • Use data only for the purpose it was collected for.

Practice

Headcount was 380 on 1 January and 337 on 31 December; 79 people left during the year. Annual attrition rate in % (1 decimal), using average headcount?

Log in to answer and get feedback

A dashboard shows average salary for a team of 3 people. What is the main concern?

Log in to answer and get feedback

Rep A closes 30k/month in a territory with 2× the potential of Rep B's, who closes 22k. Which statement is fair?

Log in to answer and get feedback

Summary

  • Segments must be measurable, distinct and actionable.
  • Productivity comparisons need like-for-like context.
  • Attrition = leavers ÷ average headcount; separate voluntary/involuntary; analyse drivers carefully.
  • People analytics demands aggregation, access control and fairness checks.