I All,
I am trying to generate an enrolment workflow that enrols students based on previous years enrolment pattern (%enrolled in a unit). For example; 5% of the students total units (from the student table) have to be enrolled in Unit ABC1. Each student id has an associated number of units they have to be enrolled in. Any suggestion would be appreciated.
Enrolment table
course_code | Unit_code | percentage to be enrolled |
CXX1 | ABC1 | 5 |
CXX1 | ABC2 | 10 |
CXX1 | ABC3 | 5 |
CXX1 | ABC4 | 2 |
CXX1 | ABC5 | 8 |
CXX1 | ABC6 | 6 |
CXX1 | ABC7 | 7 |
CXX1 | ABC8 | 4 |
CXX1 | ABC9 | 3 |
CXX1 | ABC10 | 20 |
CXX1 | ABC11 | 5 |
CXX1 | ABC12 | 5 |
CXX1 | ABC13 | 20 |
Student table.
ID | NO OF COURSES TO ENROL |
10001 | 1 |
10002 | 5 |
10003 | 2 |
10004 | 1 |
10005 | 1 |
10006 | 1 |
10007 | 1 |
10008 | 1 |
10009 | 1 |
10010 | 1 |
10011 | 5 |
10012 | 4 |
10013 | 4 |
10014 | 4 |
10015 | 4 |
10016 | 4 |
10017 | 4 |
10018 | 2 |
10019 | 2 |
10020 | 3 |
10021 | 3 |
Solved! Go to Solution.
Hi @flojosx
Here's a solution for you
The workflow starts by calculating the total number of courses required to fill the students requirements(Bottom input). This number is append to all the records in the Enrollment table and is used to calculated the rounded number of students per course. The topmost container adjusts the number allocated to the largest class to account for the errors induce by the rounding process. This list is then expanded so there is 1 slot per Course per student and ordered by unit ID. We now have 2 lists with the same number of records, this list and the original list (student per course) but ordered by unitID in one case and Student in the other. Joining the 2 lists by record positions does the assignment you need resulting in
Final 2 summarize tools are just validations that the final totals match the required totals for both courses and students
Dan
Wow Dan thanks you so much for your help. Very clever approach! Thank you. Thank you!