Copy-pasting from an email exchange:
Need
help. In the activity completion report, we do not get cohort id /name.
Could you please modify this system report to include cohort id?
Within my current limited understanding of moodle, I don't think this is possible.
We
can write some sort of ad-hoc report to have the contents of the
activity completion report with cohort being one of the fields, but that
would end up being
very complicated, because of the different numbers and names of activities over different courses.
A
simpler option might be to filter inside google sheets or Excel based
on users in the cohort you desire, after importing the csv of activities
as one sheet,
and the list of users + cohort in another sheet. An example is shown here.
(attached file removed)
In the Method1 sheet, the last field EZ has been filtered to include only Cohort_2_2023
There is one complication. Each user can appear in more than one cohort. I've used the LOOKUP function to map user to cohort,
=LOOKUP(B27,Cohortusers!D27:Cohortusers!D3199,Cohortusers!A27:Cohortusers!A3199)
but I think the LOOKUP function returns only the last cohort to which the user belongs.
A better option might be, if you know which cohort you want, to use a function like
=IF(COUNTIF(OnlyCohortusers!$D$2:OnlyCohortusers!$D$87, B2)>0,"Yes","No")
This has been implemented in the Method2 sheet of the same spreadsheet file.
For some reason, both these methods seem to return 137 rows, even though the OnlyCohort sheet has only 85 rows of data.
I'm not sure why.
I have obtained the cohort users using a "custom report",
User id by cohort (link removed)
Hope this helps.