Enterprise Reporting
  • Introduction
  • Understanding reports with clarity (Definitions)
  • Optimizing key performance indicators (via the Groups tab)
    • Dashboard
    • Reporting section
      • Progress report
      • Adoption report
      • Engagement report
      • Content insights
        • XP
        • Courses
        • Projects
        • Tracks
      • Assessments
      • Certifications
      • Time in Learn
      • DataLab
      • Export
    • Skill Matrix
  • Integrating our data into your tools (via Data Connector 2.0)
    • Explore the data model
      • Fact tables
      • Dimension tables
      • Bridge tables
      • Metrics tables
    • Common use cases
    • Sample queries
    • Queries to recreate key reports in the Groups tab
      • Dashboard
        • Members who have earned XP
      • Reporting section
        • Progress report
        • Content insights
        • Assessments
        • Certification Insights
        • Time in Learn
    • Domain Gotchas
    • Getting started with Data Connector 2.0
      • Enable Data Connector 2.0
      • Your credentials
      • Storing your credentials
    • Using Data Connector 2.0
      • Integrating with your BI tools
        • Microsoft Power BI
        • Tableau
        • Looker
        • DataLab
      • Downloading your data
        • S3 Browser (Windows)
        • Cyberduck (Mac or Windows)
        • AWS CLI (Linux)
    • Changelog
    • Migrating from Data Connector 1.0
  • FAQ
  • Data Connector 1.0 - Documentation
    • [Data Connector 1.0] Explore Data Model
      • [Data Connector 1.0] Data Model
      • [Data Connector 1.0] Changelog
      • [Data Connector 1.0] Example queries
    • [Data Connector 1.0] Getting started
      • [Data Connector 1.0] Enabling the Data Connector
      • [Data Connector 1.0] Your Credentials
      • [Data Connector 1.0] Storing your Credentials
    • [Data Connector 1.0] Using the Data Connector
      • [Data Connector 1.0] Analyzing data
        • [Data Connector 1.0] DataLab
        • [Data Connector 1.0] Microsoft Power BI
        • [Data Connector 1.0] Tableau
      • [Data Connector 1.0] Downloading data
        • [Data Connector 1.0] S3 Browser (Windows)
        • [Data Connector 1.0] 3Hub (Mac)
        • [Data Connector 1.0] AWS CLI (Linux)
    • [Data Connector 1.0] Data Connector FAQ
      • [Data Connector 1.0] Deprecating dcdcpy and dcdcr
Powered by GitBook
On this page
  1. Integrating our data into your tools (via Data Connector 2.0)
  2. Queries to recreate key reports in the Groups tab
  3. Reporting section

Certification Insights

PreviousAssessmentsNextTime in Learn

Last updated 1 month ago

To replicate the Certification Activity table, you can use the following query:

WITH current_members AS (
      SELECT
          user_id
      FROM data_connector_1234.bridge_user_group
      WHERE ended_at IS NULL
    ),

    all_events AS (
      SELECT
          user_id,
          certification_id,
          event_name,
          occurred_at,
          attempt_id
      FROM data_connector_1234.fact_certification_events
      WHERE event_name IN ('certification_registered', 'certification_granted', 'certification_failed')
    ),

    registration_events AS (
      SELECT 
          user_id,
          certification_id,
          event_name,
          occurred_at,
          attempt_id
      FROM all_events
      WHERE event_name = 'certification_registered'
    ),

    granted_events AS (
      SELECT 
          user_id,
          certification_id,
          event_name,
          occurred_at,
          attempt_id
      FROM all_events
      WHERE event_name = 'certification_granted'
    ),

    failed_events AS (
        SELECT 
            user_id,
            certification_id,
            event_name,
            occurred_at,
            attempt_id
        FROM all_events
        WHERE event_name = 'certification_failed'
    ),

    all_events_with_status AS (
        SELECT
            coalesce(ge.user_id, re.user_id) AS user_id,
            coalesce(ge.certification_id, re.certification_id) AS certification_id,
            re.occurred_at AS started_at,
            ge.occurred_at AS ended_at,
            'granted' AS status
        FROM granted_events AS ge
        LEFT JOIN registration_events AS re 
            ON ge.attempt_id = re.attempt_id

        UNION ALL 

        SELECT                
            coalesce(fe.user_id, re.user_id) AS user_id,
            coalesce(fe.certification_id, re.certification_id) AS certification_id,
            re.occurred_at AS started_at,
            fe.occurred_at AS ended_at,
            'failed' AS status
        FROM failed_events AS fe
        LEFT JOIN registration_events AS re 
            ON fe.attempt_id = re.attempt_id

        UNION ALL 

        -- Everything else is considered as 'in progress'
        SELECT
            re.user_id AS user_id,
            re.certification_id AS certification_id,
            re.occurred_at AS started_at,
            NULL AS ended_at,
            'in_progress' AS status
        FROM registration_events AS re
        LEFT JOIN granted_events AS ge 
            ON re.attempt_id = ge.attempt_id
        LEFT JOIN failed_events AS fe 
            ON re.attempt_id = fe.attempt_id
        WHERE ge.user_id IS NULL 
            AND fe.user_id IS NULL
    )

SELECT 
    user.email,
    certification.certification_name,
    events.started_at,
    events.ended_at,
    events.status
FROM all_events_with_status AS events
INNER JOIN current_members AS members 
    ON events.user_id = members.user_id
LEFT JOIN data_connector_1234.dim_user AS user
    ON events.user_id = user.user_id
LEFT JOIN data_connector_1234.dim_certification AS certification
    ON events.certification_id = certification.certification_id
ORDER BY user.email