1 Reply Latest reply on Dec 8, 2014 5:53 AM by mikebeargie

    Calculation question...

    praimondo

      I have a recipe database that looks up ingredients from another database. the second database has detail info on each ingredient including price.

      I currently look up the ingredient and it will calculate the cost based on the amount used in the recipe. This all works great!

      I want to add calories to the ingredient listing (database) and have them look up and report in the recipe database.

      The issue is calulating the calories based on the amount of the ingredient used... make sense?

      I can do it for the cost but having trouble figuring out the calorie thing...figured it would be similar, but not the case for me so far.

       

      Database 1 is the one that reports the final recipe and lets you build the recipes. The various fields are drop down menus that use value lists or look up in the database #2.

      Database #2 is only the ingredient list and contains many fields about each ingredient....example - bottle size, pack size, total cost cost per oz. import company etc...

      the recipe database only has the fileds to build the recipe and calulate the cost. and margins...

      thanks for any help out there.

        • 1. Re: Calculation question...
          mikebeargie

          From a scientific method perspective, you're not really going to get an accurate calorie count. Reason being is that caloric values change in between raw ingredients and final product for mostly every food product sold in a processed form. (sorry, wife's a scientist so I had to note that in there).

           

          That being said, you can either do a total raw caloric count by storing a "per unit" measure of calories with your products table, and deriving the caloric value based on the recipe.

           

          EG  if you have "white flour" with a value of 1,592 calories per pound (unit) and is priced at $.56 per pound, and you have a recipe that calls for 2.5# (units) of flour, you could say that is 3,980 calories and $1.40.

           

          Just treat calories the same way you're treating price (calories-per-unit lookup, instead of price-per-unit lookup) and you should be fine.

           

          Then a plain summary field will calculate your sum total calories for the recipe, and you can even go further and divide that to get a per-serving calorie value of the recipe.

           

          I think the hardest part would just be to get that per-unit value entered into your products table, not sure how much data you have there.