For the complete documentation index, see llms.txt. This page is also available as Markdown.

Time in Learn

To replicate the Time spent per month in all content types chart, you can use the following query:

SELECT
    date_trunc('month', occurred_at) as month,
    course_variant_id, 
    if(sum(duration_engaged) = 0, 0, sum(duration_engaged) / 3600) AS total_hours_on_learn
FROM data_connector_1234.fact_learn_events
-- The chart includes the current month and 11 months before
WHERE date(occurred_at) between
    date_trunc('month', date_add('month', -11, current_date)) and current_date
GROUP BY 1,2
ORDER BY 1,2

Last updated