Cohort report
Good Afternoon,
I am wanting to extract a cohort report. This is a list of cohorts that have been enrolled into the e-Learning program. This should include manual cohorts and program enrolments. Could you give me the steps of how to get this information?
-
Thanks for the question, Meaghan. Please look for a response from our CS team soon.
0 -
Would something like this be what you are after?
----SELECT A.name, A.Context, B.count from
(SELECT mdl_cohort.id, name,
CASE
WHEN mdl_context.contextlevel = 10 THEN 'Site Level'
WHEN mdl_context.contextlevel = 40 THEN (Select name FROM mdl_course_categories where mdl_context.instanceid = mdl_course_categories.id)
WHEN mdl_context.contextlevel = 50 THEN (Select fullname FROM mdl_course where mdl_context.instanceid = mdl_course.id)
END AS Context
FROM mdl_cohort
INNER JOIN mdl_context ON mdl_cohort.contextid=mdl_context.id)A
Left JOIN
(SELECT cohortid, count(*) As Count from mdl_cohort_members Group BY cohortid)B ON B.cohortid=A.id0
Please sign in to leave a comment.
Comments
2 comments