This case study focuses on creating joins to add group names to your data source on Lambda Analytics.
This case study will cover the process of adding tables that allow you to include a user's group name (in the context of a course). For the purposes of this case study, we will add tables to the Grades Data Source.
To begin, you will need to duplicate the public Grades Data Source. To duplicate the Grades data source:
1. In the Lambda Analytics homepage, click View Existing under the Data Sources link on the top navigation bar.
2. Right-click the Grades Data Source and select Duplicate. Now you have an editable copy of the Grades data source.
To add the required tables to your newly copied Grades Data Source:
1. Right-click the Grades Data Source and select Edit to access the Edit Data Source page.
2. Underneath the Data Source Design heading, click Edit with Data Source Designer to open the Display tab.
3. Navigate to the Tables tab.
4. Move mdl_groups and mdl_group_members from the left to the Selected Tables on the right.
5. Navigate to the Joins tab and create the following joins:
Courses: From the left table, select the course field from the mdl_course_completions table. Then, from the right table select the course field from the mdl_groups table. Click the Left Outer Join button.
Users: From the left table, select the userid field from the mdl_course_completions table. Then, from the right table select the userid field from the mdl_group_members table. Click the Left Outer Join button.
Groups: From the left table, select the ID field from the mdl_groups table. Then, from the right table select the groupid field from the mdl_group_members table. Click the Left Outer Join button.
6. Navigate to the Display tab.
7. In the Resources panel, expand JoinTree_1, then expand the mdl_groups table.
8. Select the name field and drag it into the User set in the Sets and Items panel.
9. In the Sets and Items panel, select the newly added name item.
10. In the Properties panel, click Edit.
11. In the Label field, rename the name item to "Group Name," for presentation purposes.
12. Once you are complete, click Save.
13. Click OK to save your changes in the Data Source Designer and return to the Edit Data Source page.
14. Under the Required Information heading, rename the Grades Data Source to avoid confusing it with the existing Grades Data Source. We will call this new data source the "Lambda Grades Data Source."
15. Once you are complete, click Submit.
If users belong to multiple groups within one course, you may see situations where it appears like the user is duplicated in your reports. This is a result of the user belonging to one or more groups. This can be corrected with effective use of filters.