Revenue calculations based on volume discounts

G

Guest

Hi,
I am developing a database that should be used for royalty reporting. For
every customer I have the following information; a number of different
products that a customer buys, quarterly volumes of these products which I
have chosen to store in fields depending on which quarter they are sold. The
revenues from these sales are then dependant of what volumes the customer
have reached over time i.e. a type of volume discounting. Hence when a
customer reaches a certain volume they obtain a smaller unit price. The
volume levels and corresponding pricing have been placed in a separate table
where the upper volume limit for each intervall are placed in separate fields
with the unit price for that intervall next to it in a separate field. What I
want to do now is calculate my revenue based on the accumulated volume over
time i.e. I want to sum the volumes for a specific customer and product for
all reported periods and then I want access to multiply the volumes by the
unit price. For example if customer A have produced 5.000 units in Q1, 10.000
units in Q2 and 10.000 units in Q3 access should muliply the first 10.000
units (upper limit for volume level 1) with the price 1,0, then I want it to
muliply the next 10.000 units (upper limit for level 2 = 20.000) with 0,8 and
at least the last 5.000 units with 0,6. Does anyone have any suggestions of
how I should go about creating such a query? Note that the volume levels as
well as its corresponding prices are different for different products and
customers but generally there are no more then 6 different levels.

Since I have placed the volumes and volume intervalls in different tables I
have had some problems with a chartesian join and I guess it would be more
resonable to put everything in one table since the customer and product
information are the same both for volumes, volume intervalls and
corresponding prices. However even if I do so I have no good idea of how I
should solve the rest of my problems.

Very greatful to answers / Bell
 
T

Tom Ellison

Dear Bell:

For what it's worth, I've worked with complex discounting several times. It
can be tough!

Initially, some questions are inserted in your text below:


Bell said:
Hi,
I am developing a database that should be used for royalty reporting. For
every customer I have the following information; a number of different
products that a customer buys, quarterly volumes of these products which I
have chosen to store in fields depending on which quarter they are sold.

It is not a good idea to store quarterly volumes, but to aggregate them from
the raw data each time they are needed.
The
revenues from these sales are then dependant of what volumes the customer
have reached over time i.e. a type of volume discounting.

Is the volume a quantity, a dollar amount, or some other factor? Is the
discounting a percent of sales, a fixed amount per item, or some other
method?
Hence when a
customer reaches a certain volume they obtain a smaller unit price. The
volume levels and corresponding pricing have been placed in a separate table
where the upper volume limit for each intervall are placed in separate fields
with the unit price for that intervall next to it in a separate field. What I
want to do now is calculate my revenue based on the accumulated volume over
time i.e. I want to sum the volumes for a specific customer and product for
all reported periods and then I want access to multiply the volumes by the
unit price. For example if customer A have produced 5.000 units in Q1, 10.000
units in Q2 and 10.000 units in Q3 access should muliply the first 10.000
units (upper limit for volume level 1) with the price 1,0, then I want it to
muliply the next 10.000 units (upper limit for level 2 = 20.000) with 0,8 and
at least the last 5.000 units with 0,6. Does anyone have any suggestions of
how I should go about creating such a query? Note that the volume levels as
well as its corresponding prices are different for different products and
customers but generally there are no more then 6 different levels.

Depending on how your discounting is implemented, it may be possible to
precalculate the discount for each bracket, so there is, for each bracket, a
fixed amount of discount plus a percentage of sales over a given amount.
This reduces the total calculations for each individual account. This will
depend on the answers to my many questions.

The software should be written to work for any number of levels, whether
there are 6 or 600.
Since I have placed the volumes and volume intervalls in different tables I
have had some problems with a chartesian

It's Rene Decart (extremely important mathematician and logician), so you
can say Cartesian. Anyway, send the details along and we'll try to proceed.
 
G

Guest

Dear Tom,

what I'm doing is just an application for keeping track of our royalty sales
since it has become a little to time consuming to carry out in Excel but who
knows, Excel might be easier after all.

Regarding the storing of volumes into fields that correspond to to a
quarter, this is the way our customers report to us. However I have been
considering having the period as a field itself i.e. that is variable between
different records, which might be more correct. However I then get the
problem of not knowing how to make good looking forms and how a should secure
that every new quarter will contain all customers, their corresponding
products and its pricing and volume levels. Futhermore I am afraid that using
the structure that I have today i.e. all data in one table with quarters as
fields could create benefits when it comes getting data out of the database
through parameters and so on. Any comments?

Regarding the rest of your questions; Yes it is a volume discount which
implies that a customer pays a certain price per unit up to a certain level.
When the purchased volumes exceed the first level the customer pays a lower
price per unit for the volumes in the second bracket and so on.

Today I put all data into one table and tried to make the calculations from
there and since I had some problems getting it to work I have been trying
using several queries where the second one is based on the first one and so
fourth. I have been tryng with an IIf statement to come up with the correct
calculations but the IIF statement wont take my , after the truepart and so I
switched it to an OR just to be able to get a SQL View of my work. Access
also asks me for entering parameter values and I can't really see why. Can
you see anything wrong with this statement?

SELECT VolumeSum1.Customer, VolumeSum1.Product,
IIf([VolumeSum1]![RunningSum]>[Data]![Level5],[VolumeSum2]![RS-L5]*[Data]![Price6]+[VolumeSum2]![L5-L4]*[Data]![Price5]+[VolumeSum2]![L4-L3]*[Data]![Price4]+[VolumeSum2]![L3-L2]*[Data]![Price3]+[VolumeSum2]![L2-L1]*[Data]![Price2]+[Data]![Level1]*[Data]![Price1]
Or
IIf([VolumeSum1]![RunningSum]>[Data]![Level4],[VolumeSum2]![RS-L4]*[Data]![Price5]+[VolumeSum2]![L4-L3]*[Data]![Price4]+[VolumeSum2]![L3-L2]*[Data]![Price3]+[VolumeSum2]![L2-L1]*[Data]![Price2]+[Data]![Level1]*[Data]![Price1]
Or
IIf([VolumeSum1]![RunningSum]>[Data]![Level3],[VolumeSum2]![RS-L3]*[Data]![Price4]+[VolumeSum2]![L3-L2]*[Data]![Price3]+[VolumeSum2]![L2-L1]*[Data]![Price2]+[Data]![Level1]*[Data]![Price1]
Or
IIf([VolumeSum1]![RunningSum]>[Data]![Level2],[VolumeSum2]![RS-L2]*[Data]![Price3]+[VolumeSum2]![L2-L1]*[Data]![Price2]+[Data]![Level1]*[Data]![Price1]
Or
IIf([VolumeSum1]![RunningSum]>[Data]![Level1],[VolumeSum2]![RS-L1]*[Data]![Price2]+[Data]![Level1]*[Data]![Price1],[VolumeSum1]![RunningSum]*[Data]![Price1]))))) AS Revenue
FROM VolumeSum1, Data, VolumeSum2
GROUP BY VolumeSum1.Customer, VolumeSum1.Product,
IIf([VolumeSum1]![RunningSum]>[Data]![Level5],[VolumeSum2]![RS-L5]*[Data]![Price6]+[VolumeSum2]![L5-L4]*[Data]![Price5]+[VolumeSum2]![L4-L3]*[Data]![Price4]+[VolumeSum2]![L3-L2]*[Data]![Price3]+[VolumeSum2]![L2-L1]*[Data]![Price2]+[Data]![Level1]*[Data]![Price1]
Or
IIf([VolumeSum1]![RunningSum]>[Data]![Level4],[VolumeSum2]![RS-L4]*[Data]![Price5]+[VolumeSum2]![L4-L3]*[Data]![Price4]+[VolumeSum2]![L3-L2]*[Data]![Price3]+[VolumeSum2]![L2-L1]*[Data]![Price2]+[Data]![Level1]*[Data]![Price1]
Or
IIf([VolumeSum1]![RunningSum]>[Data]![Level3],[VolumeSum2]![RS-L3]*[Data]![Price4]+[VolumeSum2]![L3-L2]*[Data]![Price3]+[VolumeSum2]![L2-L1]*[Data]![Price2]+[Data]![Level1]*[Data]![Price1]
Or
IIf([VolumeSum1]![RunningSum]>[Data]![Level2],[VolumeSum2]![RS-L2]*[Data]![Price3]+[VolumeSum2]![L2-L1]*[Data]![Price2]+[Data]![Level1]*[Data]![Price1]
Or
IIf([VolumeSum1]![RunningSum]>[Data]![Level1],[VolumeSum2]![RS-L1]*[Data]![Price2]+[Data]![Level1]*[Data]![Price1],[VolumeSum1]![RunningSum]*[Data]![Price1])))));

Sincerely, Bell

"Tom Ellison" skrev:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top