2 Replies Latest reply on Mar 18, 2013 8:48 AM by TaoJiang

    How to calculate a total toll from multiple pipeline connecting to each other

    TaoJiang

      Title

      How to calculate a total toll from multiple pipeline connecting to each other

      Post

           Hello everyone, I am current building a database of all oil pipelines. My ultimate goal is that users are able to just put start pioint (usually City) and End point, then the database can return the total pipeline toll which is usually sum of multiple connecting pipelines that will bridge the start point and end point.  I have created a simply database with most of pipeline information. The question I have now is how to create a mechnisim that allow user to perform such task?  do I need to write script?  Thanks Everyone.

            

            

        • 1. Re: How to calculate a total toll from multiple pipeline connecting to each other
          philmodjunk

               Before talking scripts, we have to talk about your data model.

               You need a table where each Pipline section and the fees for each form a separate record. Do you have that?

               Then you can compute the total charge for a particular delivery in a different related table where you specify the volume delivered. A join table would also be needed where you "build" the list of selected Pipeline sections needed for a given delivery.

               And this is just the start. Additional tables and relationships are also likely to be needed--especially if specific "deliveries" are a repeating event--perhaps with variations in the precise volume delivered.

               I'm thinking in terms of this:

               Customers------<DeliveryInvoice-----<DeliveryRoute>------PipeLineSections

               Customers::__pkCustomerID = DeliveryInvoice::_fkCustomerID
               DeliveryInvoice::__pkDelInvoiceID = DeliveryRoute::_fkDelInvoiceID
               PipeLineSections::__pkPipeID = DeliveryRoute::_fkPipeID

               Note, that this is essentially the same structure as is typical of any sales invoice system:

               Customers----<Invoices-----<LineItems>--------Products

               But instead of a lineItems table that lists individual items purchased, we have sections of PipeLine through which a given delivery may be routed. Thus, you may find it helpful to examine the invoice starter solution that comes with your copy of either FIleMaker 11 or FileMaker 12.

               For an explanation of the notation that I am using, see the first post of: Common Forum Relationship and Field Notations Explained

          • 2. Re: How to calculate a total toll from multiple pipeline connecting to each other
            TaoJiang

                 Thank Phil for ur expedit reply. I am still new to filemaker. Will give a try tonight.