9 Replies Latest reply on Apr 8, 2016 9:11 AM by Dlegare

    Calculation problem



      We are a manufacturing plant and I created a Filemaker application to create production form.

      I have the final product in a table and a raw materials table.


      I Create a portal with calculation to know the receipe or the breakdown of products to be create on the production line.

      So example, my product is a Chocolate cake, I have the breakdown of materials so:

      Egg  3

      Cacao 200ml

      Flour 500g



      So my calculation is like

      3 cakes:

      Egg  9

      Cacao 600ml

      Flour 1500g



      Everything work well, but, when i have to create the same products for an other time the calculation stop to work and replace the numbers by the previous products made.


      There is a way to create a calculation independent per record?


      Thank you

        • 1. Re: Calculation problem

          Use global variables.

          • 2. Re: Calculation problem

            Ok thank you so my formula is :

            Quantity * DevisSacs 2::Quantity


            should i use LET like :

            Let($Quantity=Quantity;$Quantity*DevisSacs 2::Quantity)


            please let me know

            thank you

            • 3. Re: Calculation problem

              You should expand your vision and learn what are, how to use, problems with, joys of, etc... global variables.

              • 4. Re: Calculation problem

                It's hard to tell what you're asking, but I suspect you may need a new table, a Recipes table.


                Why don't you try posting the question in your native language along with an example file?

                • 5. Re: Calculation problem

                  No problem
                  Already we have a recipe table.
                  We are a manufacturing company in the field of the bag.
                  I created several tables, one for finished products and another for raw materials.
                  Before starting a production bag, we have to fill a form by choosing the model name, customer name etc. On the back of this form, product recipe appears in a Portal. then we can identify all the elements making up the bag.
                  A calculation is made on the form by taking the amount of the bag within the form multiplied by the quantity of the pieces recipe to give me a total of piece.Mon calculation works. However, when I created the same product with a different amount, it just add the two totals together

                  Bag # 123 on 01/01/2016 qty: 3 bags
                  Piece # 1 = 3 pieces = 9 parts to produce
                  Parts # 2 = 4 pieces = 12 pieces to produce

                  Bag # 123 on 02/16/2016 qty: 2 bags
                  Piece # 1 = 3 pieces = 6 pieces to produce + (9 pieces a produce 01/01/2016)
                  Parts # 2 = 4 pieces = 8 pieces to produce + (12 pieces a produce 01/01/2016)

                  What kind of formula or works is that I could use to make each record independent of the other?
                  Thank you for your help hoping that it is clearer to you

                  Thank you




                  Pas de probleme

                  Nous avons deja une table de recette.

                  Nous sommes une compagnie manufacturiere dans le domaine du sac.

                  J'ai cree plusieurs tables dont une pour les produits finis et une autre pour les matieres premieres.

                  Avant de lancer un sac en production, nous devons remplir un formualire en choississant le nom du modele,le nom du client etc. Au verso de ce formulaire, la recette du produit apparait dans un portal. alors nous pouvons identifier tous les elements constituant du sac.

                  Un calcul se fait dans le formulaire en prenant la quantite du sac inscrit dans le formulaire multiplié par les quantités des pieces de la recette pour me donner un total par piece.Mon calcul fonctionne . Cependant,  lorsque je cree le meme produit avec une quantite differente, il vient additionner les deux totaux ensemble



                  Sac #123 le 01/01/2016  qty:3 sacs

                  piece #1 = 3 pieces = 9 pieces a produire

                  pieces #2= 4 pieces = 12 pieces a produire


                  Sac #123 le 02/16/2016  qty:2 sacs

                  piece #1 = 3 pieces =  6 pieces a produire+(9 pieces a produire du 01/01/2016)

                  pieces #2= 4 pieces = 8 pieces a produire+(12 pieces a produire du 01/01/2016)


                  Quel type de formule ou de fonctionne est ce que je pourrais utiliser pour rendre chaque record independant un des autres?

                  Merci de votre aide en esperant que cela est plus clair pour vous



                  • 6. Re: Calculation problem

                    I think I understand where you problem is coming from, but it's hard to explain without having an example file to work with. Can you post a copy of your file?


                    I don't think your problem is calculations, but in tables and relationships.

                    • 7. Re: Calculation problem


                      thank you for your help

                      here he goes.



                      The app is in french so the calculation will be in the button Devis - Devis Sacs- You can see the receipe at the bottom of the form.

                      let me know if you need help

                      thank you

                      Dropbox - JRZ_original.fmp12.2016-04-06-11-08.zip

                      • 8. Re: Calculation problem

                        Your relationships are the problem. I'm not sure of what all the tables and relationships are doing, so I can't give 100% advice and it depends on your ultimate goals.

                        If all you're doing is printing and viewing, you could do the calculations on the fly like you are now. But you'd need to rearrange your graph and it gets real tricky real fast. Generally if you're starting from one TO and have to pull data from a TO three or more relationships away, you're doing it wrong. To cheat, you can do what siplus recommended and when a record loads, capture the quantity of DeviSacs in a global variable and then use that $$var in the MetieresPremieres quantity calculation in place of the DeviSacs quantity.


                        But really, you should be storing each MetieresPeremieres item in its own table for that specific bag build. That gives you historical data and makes this process a lot easier. It's a bigger change that requires some scripting.

                        • 9. Re: Calculation problem

                          Hello David

                          thank you for your fast reply


                          I think it's a big job


                          Si if a store all Matieres Premiere ( Raw materials)  table per model  would be one of the best option?

                          I'm not an expert for scripting so i would create the simplest and efficient way.

                          thank you

                          let me know