# Thread: Calculating a distribution (2003 sp2)

1. ## Calculating a distribution (2003 sp2)

An account or holder, may have many assets and an asset may be held by many holders. When I receive a file that contains a list of properties (Assets) with related fees for taxes or insurance, it is my job to charge the holders their percentage of the fee based on the units they hold of the particular asset. I have always done this in a query by multiplying the fee by the fractional share. This has always left a few rounding issues that I have dealt with manually. If a property is held in three accounts, .333, .333, and .334, how could I calculate the first two and just assign the balance to the third. Or if there were five holders assign the balance to the fifth, and so on?

2. ## Re: Calculating a distribution (2003 sp2)

First of all, you can use the Round() function to handle the rounding, something like round(share * Fee,2) will round to cents.

Making the sum of distributions equal to the total Fee (for example) is a little trickier. Assuming you have written some sort of transaction record, you could sum the transactions for each Fee and compare the totals, to see how much of an adjustment (if any) needs to be made to that "last" account. The problem is, which is the "last" account for an asset?

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•