TM Diversity
1. Dataset Name
tm_diversity
2. Description
An employee-level dataset built for diversity, equity, and inclusion analytics on the Talent Management platform. Each row represents one employee-skill pair — the base employee record is enriched with mentorship flags, direct report counts, succession plan data, and profile skill information. Key derived flags (is_female, is_urm, is_leader, is_stagnant, is_progressing, tenure_days) are computed inline from employee attributes. This dataset powers headcount diversity metrics, gender and race distribution charts, succession pipeline diversity, and skill-level gender distribution on the TM Diversity dashboard.
3. Source Tables
- customer_views.employee (primary employee record — aliased emp)
- customer_views.employee_skills (aliased es in employee_skills_enriched CTE — profile skills, LEFT JOINed to customer_views.role_skills to flag role skill matches)
- customer_views.role_skills (aliased rs — required role skills, joined via jie_role_id = position_id and skill_name)
- customer_views.profile_data (emp_mentorship CTE — namespace = 'mentorship', provides is_mentor and is_mentee flags per profile)
- customer_views.succession_plan (succession_agg CTE — incumbent and successor attributes for succession pipeline diversity metrics)
4. Grain
One row per employee-skill pair. An employee with ten profile skills will have ten rows. Succession and mentorship columns are denormalized at the employee level (same value on every row for a given employee). num_reports_data derives the manager's direct report count by grouping on manager_email, then joining back to the employee table.
5. Dashboards Supported
- TM Diversity Dashboard
6. Metrics Supported
| Metric | Supported Breakdowns |
| Total Employees | location_country, business_unit, job_function |
| Total Female Employees | location_country, business_unit, job_function |
| Total Female Employees % | location_country, business_unit, job_function |
| Total URM Employees | location_country, business_unit, job_function |
| Total URM Employees % | location_country, business_unit, job_function |
| Pipelines with female successors % | business_unit, job_function, location_country |
| Pipelines with URM successors % | location_country, business_unit, job_function |
| Employee Distribution by Gender | location_country, business_unit, job_function |
| Employee Distribution by Race | location_country, business_unit, job_function |
| Gender Distribution - Employee Skills | location_country, business_unit, job_function |
| Race Distribution - Employee Skills | location_country, business_unit, job_function |
| Employee diversity by Job Function | location_country, business_unit, seniority |
| Employee diversity by Business Unit | location_country, job_function, seniority |
| Employee diversity by Location | business_unit, job_function, seniority |
| Pipelines with diverse successors | No drilldowns |
7. Known Exclusions / Filters Applied
- employee_id IS NOT NULL is the primary active-employee filter applied at the widget level — it excludes alumni, incomplete profiles, and any record without a valid employee ID.
- is_female is derived as CASE WHEN emp.gender = 'female' THEN TRUE ELSE FALSE END — case-sensitive match on the raw gender field.
- is_urm is derived via COALESCE(CAST(get_json_object(attributes_json, '$.is_ethnically_diverse[0]') AS BOOLEAN), FALSE) — URM status comes from the is_ethnically_diverse attribute in the employee's JSON attributes, defaulting to FALSE when absent.
- is_leader is derived as CASE WHEN seniority IN ('CXO', 'Vice President', 'Director') THEN TRUE ELSE FALSE END.
- successor_is_urm in the succession_agg CTE classifies a successor as URM when their race falls into: American Indian or Alaskan Native, Black, Hispanic, Two or More Races, or Native Hawaiian or Pacific Islander (all lowercased via LOWER()).
- Succession columns (succession_position_id, successor_gender, successor_is_urm, etc.) are NULL for employees not found in customer_views.succession_plan as an incumbent. % Pipelines metrics use NULLIF to guard against division by zero.
- business_unit, lob (aliased as job_function), and location_country are all lowercased via LOWER() at dataset level.
- All metrics are all-time snapshots — no date range filters are applied in this dataset.
8. Schema
| Column Name | Data Type | Notes |
| profile_id | bigint | Employee's profile identifier; sourced from employee. Primary COUNT DISTINCT grain for employee-level metrics. |
| employee_id | varchar | Employee identifier; sourced from employee. IS NOT NULL filter applied at widget level to scope to active employees. |
| employee_name | varchar | Derived: CONCAT(first_name, ' ', last_name) from employee |
| employee_email | varchar | LOWER(employee_email); sourced from employee |
| business_unit | varchar | LOWER(business_unit); sourced from employee. Breakdown column for Employee diversity by Business Unit. |
| job_function | varchar | LOWER(lob); sourced from employee (aliased from lob). Breakdown column for Employee diversity by Job Function. |
| location_country | varchar | LOWER(location_country); sourced from employee. Breakdown column for Employee diversity by Location. |
| gender | varchar | Raw gender value; sourced from employee. Breakdown column for Employee Distribution by Gender and Gender Distribution - Employee Skills. |
| race | varchar | Raw race/ethnicity value; sourced from employee. Breakdown column for Employee Distribution by Race and Race Distribution - Employee Skills. |
| seniority | varchar | Seniority level; sourced from employee |
| is_female | bigint | Derived: TRUE when employee.gender = 'female', FALSE otherwise. |
| is_urm | bigint | Derived: COALESCE(CAST(get_json_object(attributes_json, '$.is_ethnically_diverse[0]') AS BOOLEAN), FALSE) from employee |
| is_leader | bigint | Derived: TRUE when seniority IN ('CXO', 'Vice President', 'Director'). |
| is_terminated | bigint | Derived: TRUE when termination_date IS NOT NULL; sourced from employee |
| is_stagnant | bigint | Derived: TRUE when num_internal_experiences <= 1 AND (hiring_date IS NULL OR role_change_date = hiring_date). |
| is_progressing | bigint | Derived: TRUE when num_internal_experiences > 1 OR role_change_date != hiring_date. |
| tenure_days | bigint | Derived: DATEDIFF(COALESCE(termination_date, CURRENT_DATE), hiring_date) from employee |
| is_mentor | bigint | Derived: TRUE when mentee_count > 0 in profile_data (namespace = 'mentorship'). COALESCE to FALSE when absent. |
| is_mentee | bigint | Derived: TRUE when mentor_count > 0 in profile_data (namespace = 'mentorship'). COALESCE to FALSE when absent. |
| num_reports | bigint | Derived: COUNT(profile_id) per manager_email from employee (num_reports_data CTE). COALESCE to 0 when no direct reports. |
| succession_position_id | bigint | Succession position identifier; sourced from succession_plan. NULL when employee is not an incumbent. |
| incumbent_position_criticality | varchar | Criticality of the incumbent's position; sourced from succession_plan |
| incumbent_succession_count | bigint | Number of successors identified for the incumbent; sourced from succession_plan |
| successor_profile_id | bigint | Profile ID of the successor; sourced from succession_plan |
| successor_gender | varchar | LOWER(successor_gender); sourced from succession_plan. Used in % Pipelines with Female Successors metric. |
| successor_readiness | varchar | LOWER(successor_readiness); sourced from succession_plan |
| successor_is_urm | bigint | Derived: TRUE when LOWER(successor_race) IN ('american indian or alaskan native', 'black', 'hispanic', 'two or more races', 'native hawaiian or pacific islander'); sourced from succession_plan |
| skill_name | varchar | Skill name from the employee's profile; sourced from employee_skills (via employee_skills_enriched CTE). Primary field for skill distribution charts. |
| role_skill_name | varchar | Required skill name for the role; sourced from role_skills. NULL when the profile skill does not match any role requirement. |
| is_role_skill | bigint | Derived: 1 if skill_name matches a required role skill (role_skill_name IS NOT NULL), 0 otherwise. |
| manager_rating | double | Manager's rating for the profile skill; sourced from employee_skills |
| self_rating | double | Employee's self-rating for the profile skill; sourced from employee_skills |
| inferred_proficiency | double | Eightfold-inferred proficiency for the skill; sourced from employee_skills |
| risk_of_loss | varchar | LOWER(get_json_object(attributes_json, '$.risk_of_loss[0]')) from employee |
| impact_of_loss | varchar | LOWER(get_json_object(attributes_json, '$.impact_of_loss[0]')) from employee |
| career_interest | varchar | COALESCE(preferred_job_title, role_goal_ids) from attributes_json; sourced from employee |
| profile_completeness | double | Profile completeness score; sourced from employee |
| jie_role_id | varchar | Role identifier for the employee; sourced from employee |
| es_jie_role_id | varchar | Role identifier from the skill record; sourced from employee_skills |
| es_role_variant_id | varchar | Role variant identifier from the skill record; sourced from employee_skills |