April 19, 2019 at 4:27 am
Hi Team,
I need a help with the query to get the work balance among users in a group.
There are groups under the group there are users and users will be working on consumers. Query should do balance of the work between the users in that group.
Details: Attached both input and expected outputs
Allocation should happen as below:
For Group1:
For Group2:
For Group3:
Regards,
Eshwar.
April 29, 2019 at 10:53 pm
I think the reason why you've gotten no help is because you've not provided any readily consumable data. Please see the link in my signature below for one way to provide such a thing in lieu of a graphic of a spreadsheet.
Others wise, my suggestion would be to do a search for "Bin Fill in SQL Server".
--Jeff Moden
Change is inevitable... Change for the better is not.
May 3, 2019 at 8:43 pm
For these sorts of problems, I just allocate according to whatever formula I would ordinarily use to allocate amongst the recipients of the allocations. Then if they do not allocate evenly because of rounding errors, I then remove individual allocations to enough individual recipients of allocations (most situations I just use the last recipient of allocations) by first removing the initial allocation from one or more recipients, summing the remaining allocations, and then just reallocating the remainder to the recipient that I previously had removed the initial allocation from. This allows you to allocate in such away that the sum of the allocations will again add back up to the entirety of items to allocate. Obviously this assumes the units of allocations are equal to or greater than the allocation recipients. This step can be taken even if it reallocates an identical amount due to the situations that allocations can be assigned without producing rounding errors.
heh I really do roll like that but my post is most likely even more indecipherable than OP's LOLOL
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply