Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Assign costumers to a class based on percentage distribution of previous enrolment

flojosx
7 - Meteor

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_codeUnit_codepercentage to be enrolled
CXX1ABC15
CXX1ABC210
CXX1ABC35
CXX1ABC42
CXX1ABC58
CXX1ABC66
CXX1ABC77
CXX1ABC84
CXX1ABC93
CXX1ABC1020
CXX1ABC115
CXX1ABC125
CXX1ABC1320

 

Student table. 

 

IDNO OF COURSES TO  ENROL
100011
100025
100032
100041
100051
100061
100071
100081
100091
100101
100115
100124
100134
100144
100154
100164
100174
100182
100192
100203
100213
2 REPLIES 2
danilang
19 - Altair
19 - Altair

Hi @flojosx 

 

Here's a solution for you

 

WF.png 

 

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

 

Results.png

 

Final 2 summarize tools are just validations that the final totals match the required totals for both courses and students

 

Dan

flojosx
7 - Meteor

Wow Dan thanks you so much for your help. Very clever approach! Thank you. Thank you!

Labels