Hi all,
I run a manufacturing outfit and we do everything with filemaker since 15 years.
We produce cosmetics.
We have a product table which has a manyToMany self-join via a "components" table.
Because products are made out of Products.
So, for example, a Shampoo 300 ml, is made out of 300 ml of Shampoo, 1 Flask, 1 Label and 1/6 of a box (6 in a box).
The bulk Shampoo is made out of say 10 ingredients, which we store in another table, that we called Formulas (think of recipes, 1 kg of Shampoo has 800 g of Water, 100 g of LSS and 100g of Perfume, for example).
This whole system has worked well, but we found out, that after all, Formulas.. is actually a "Product" too.. And we think now, of eliminating this whole Formula (with FormulaItems) .
A PRODUCT.. if it is liquid has liquid components.. and a Product, that is measuered in Units has Components.
As a side kick.. It might all be too complicated to explain here.. Why would we want to change. Recently we had to comply with new regulations, and many ingredients, which we though where "pure", i.e. made out of ONE Ingredient, where actually made out of multiple Molecules. For starters.. for example all Acids.. are always in H2O, Water disolved.
So.. if you add 5g of Nitric Acid to a Shampoo.. ou actually add 2,5g of Water and 2.5g of Nitric disolved to the Formula.. So.. our Shampoo does not have 800g of Water, but 805g of Water.
We solved this, by creating TO's that go Product=Formula=FormulaItem=FormulaComponent. (FormulaComponent are the Ingredients that make Ingredients).
So.. When we tried to get rid of the whole FORMULA=FormulaItens TO's Group, substituting with Products=Components, we found that our sistem does not elegantly see may hierachy steps into subComponents.
What I am looking for, is the Calculation in a field in COMPONENTS, that connect Products<>Products, that permits to see the whole Line of Components and subComponents, with their respective Quantities, gives an error if I try to make an infinitive Loop (Connecting a Component to a Product, that contains the Product itself in its SubComponents)>
All this is very basic Recursive Database Design..
SOrry for the complex and a bit long question.. But people who have solved this problem, might understand it easily.
In the Car Factory Example;
A car is made of 4 wheels, a motor and a chassis and 20 screws.
The chassis is made of 4 doors
The door is made of 3 screws
The motor is made of 4 screws
How many screws are in a car?
Screw that.. I'going nuts..