Logic to distribute data

Can someone please help me with the logic to build below?
Please refer to the input data tables listed below.
image

image

I have to assign the students as per the teacher’s values.
e.g., the first teacher, Shubam, has to get 3 students from the second data table; for the next teacher, Ravi, he has to get the next 2 students from the second data table. Like wise, all the distribution has to be done.

Thanks,
Soundarya

@ppr Could you please help me for this one?

Hi,

Can you also share expected result?

Regards,

For shubam , the first 3 register number will be assigned from table 2 as per his value column in table 1,
for Ravi, the next 2 register number will be assigned from table 2 as per his value column in table 1,
for Aarthi, the next 5 register number will be assigned from table 2 as per his value column in table 1,
since the total count of table is 10, Subraja won’t get any.

Hope it’s helpful.

Thank you,
Soundarya

Hi,

Can you try the following sample? Does this work for you?

Sample
Sample20240509-6.zip (10.7 KB)

(This sample outputs each teacher’s file)

Regards,

Hi @soundarya_A1 ,

Please find the solution created

AssignStudentsToTeacherFromTable.xaml (26.6 KB)

Thanks for helping, will try it

Thanks for helping, appreciate it