P
pietlinden
Hi,
I have a spreadsheet that someone wrote that he wants me to turn into
a database for him.
The spreadsheet is for doing costing calculations so that the sales
rep can come up with a price that the customer agrees to. So this
thing has to be pretty flexible.
I've split out the spreadsheet so that it looks a lot more like that
ugly NWind dog. The spreadsheet I have been given basically breaks
out all the costs involved in purchasing, packaging, shipping, etc
inventory from the vendor to the final customer. So each column
calculates a separate cost. The "constants" that the column get
multiplied by are directly above the cell in question. For example, a
simple one would be "Markup Dollars", which is [PurchasePrice] * (1+
[MarkupPercent]) where MarkupPercent is an absolute reference to a
cell.
So far, the only way I can think of doing this and making it work
right is to put all the constants into the Invoice Header table and
then set the Line Items to multiply by those values. Here's the
structure of the spreadsheet that's giving me fits.
Packaging Costs
Row Guide Box_Ea Box_Freight
===================================
Min Order 1 1
Total Cost $5.00 $20.00
Cost Each =TotalCost/MinOrder
and then each of the costs is copied down the column ("=AB$5", for
example.)
The database part of my brain is thinking "create a table of costs
CREATE TABLE Costs(
CostType Text(50) NOT NULL,
CostItem Text(50) NOT NULL,
MinOrder Integer NOT NULL DEFAULT 1,
PRIMARY KEY (CostType, CostItem)
)
and then do the math in queries. The Min_Order and Total_Cost fields
are user-modifiable in the spreadsheet and the rest are pretty much
just calculated. So why not go this way? Each Cost has a 1:1
relationship with the Invoice header (spread evenly over the invoice
line items, especially when it comes to shipping, because all the
items are put in the same container and the container cost is spread
over each item inside).
Any ideas on what would be the best way to handle this? Of course, if
you have questions, feel free to ask! My description is even
confusing to me, but that could well be the myopia from staring at it
for so long.)
Right now I'm considering storing all the modifiable cost drivers in
the Invoice table, but that seems really ugly.
I must say, I have a new appreciation for Excel after doing this...
THanks for listening!
Pieter
I have a spreadsheet that someone wrote that he wants me to turn into
a database for him.
The spreadsheet is for doing costing calculations so that the sales
rep can come up with a price that the customer agrees to. So this
thing has to be pretty flexible.
I've split out the spreadsheet so that it looks a lot more like that
ugly NWind dog. The spreadsheet I have been given basically breaks
out all the costs involved in purchasing, packaging, shipping, etc
inventory from the vendor to the final customer. So each column
calculates a separate cost. The "constants" that the column get
multiplied by are directly above the cell in question. For example, a
simple one would be "Markup Dollars", which is [PurchasePrice] * (1+
[MarkupPercent]) where MarkupPercent is an absolute reference to a
cell.
So far, the only way I can think of doing this and making it work
right is to put all the constants into the Invoice Header table and
then set the Line Items to multiply by those values. Here's the
structure of the spreadsheet that's giving me fits.
Packaging Costs
Row Guide Box_Ea Box_Freight
===================================
Min Order 1 1
Total Cost $5.00 $20.00
Cost Each =TotalCost/MinOrder
and then each of the costs is copied down the column ("=AB$5", for
example.)
The database part of my brain is thinking "create a table of costs
CREATE TABLE Costs(
CostType Text(50) NOT NULL,
CostItem Text(50) NOT NULL,
MinOrder Integer NOT NULL DEFAULT 1,
PRIMARY KEY (CostType, CostItem)
)
and then do the math in queries. The Min_Order and Total_Cost fields
are user-modifiable in the spreadsheet and the rest are pretty much
just calculated. So why not go this way? Each Cost has a 1:1
relationship with the Invoice header (spread evenly over the invoice
line items, especially when it comes to shipping, because all the
items are put in the same container and the container cost is spread
over each item inside).
Any ideas on what would be the best way to handle this? Of course, if
you have questions, feel free to ask! My description is even
confusing to me, but that could well be the myopia from staring at it
for so long.)
Right now I'm considering storing all the modifiable cost drivers in
the Invoice table, but that seems really ugly.
I must say, I have a new appreciation for Excel after doing this...
THanks for listening!
Pieter