BookmarkSubscribeRSS Feed
Calcite | Level 5

## To distribute items equally to a group of people based on different workload

Hi, I have a set of report with different lines of items for each report, I would like to distribute the reports equally to a group of people by considering their workload and lines of items in the report, please find below for the data sample:

Report

 Report Line items in the report Submitted by Employee 1 3 Dong, Bin 2 1 Hu, Guang Yin 3 4 Jin, Stan 4 1 Li, Yan Hong 5 5 Shen, Ting 6 1 Shen, Ting 7 17 Sun, Tristan 8 1 Xue, Guohua 9 2 Xue, Guohua

Group of people:

Leng with workload of 0.7

Po with workload of 1.0

The distribution should meet the following requirements:

1) Report submitted by the same employee should distribute to the same person

2) Number of report distribute to the 2 persons should be equal (or 4 & 5 for total of 9)

3) Report line items should be equally distributed

4) Workload should be considered

Much appreciate if anyone could suggest me the code which can do the above distribution well, thank you!!

3 REPLIES 3
Super User

## Re: To distribute items equally to a group of people based on different workload

I have no idea what this means:

```Leng with workload of 0.7
Po with workload of 1.0```

How do we determine "workload" based on what you show.

Can you show what you would expect the output to appear like for your example?

And then show how each item in the result is determined according to your rules.

Calcite | Level 5

## Re: To distribute items equally to a group of people based on different workload

Hi, there is two ppl who need to process report everyday, one is Leng and another is Po, workload will be vary from day to day, for example, when workload equal to 1.0 for both of them, and today we have 10 reports here, then 10 divided by 2.0 and times 1.0, each of them will need to process 5 reports.

For my question above, please find below for details:

Total report received: 9 reports

Total line items in the reports: 35

The expected outcome:

Leng with workload of 0.7 should get 4 reports (9*0.7/1.7), in the 4 reports, it should have 14 line items (35*0.7/1.7)

Po with workload of 1.0 should get 5 reports (9*1.0/1.7), in the 5 reports, it should have 21 line items (35*1.0/1.7)

And there is a requirement where same report submitted by same employee should be distributed to the same person, for example, Alex has submitted 2 reports today, these two reports should be distributed to Leng or Po, it cannot be distributed one to Leng and one to Po. Hence, due to there is a such requirement, the outcome wont be distributed equally, it might have vary of one or two line items.

Calcite | Level 5

## Re: To distribute items equally to a group of people based on different workload

 Report Line items in the report Submitted by Employee Distributed to 1 3 Dong, Bin Leng 2 1 Hu, Guang Yin Po 3 4 Jin, Stan Leng 4 1 Li, Yan Hong Po 5 5 Shen, Ting Leng 6 1 Shen, Ting Leng 7 17 Sun, Tristan Po 8 1 Xue, Guohua Po 9 2 Xue, Guohua Po

Column 4 is the expected outcome where Leng will get 4 reports with total of 13 line items and Po will get 5 reports with total of 22 line items, this is bcs same report from same employee must goes to the same person.

Discussion stats
• 3 replies
• 501 views
• 0 likes
• 2 in conversation