6 Replies Latest reply on Sep 20, 2012 10:36 AM by philmodjunk

    Need Help with Simple Calculator!

    MacMcAhren

      Title

      Need Help with Simple Calculator!

      Post

           Project = Rate Calculator

           Filemaker Experience = Total Newbie

            

           I am attempting to create a simple rate calculator. This would be pushed to Filemaker Go for use on iPads and iPhones in the feild.

           Calculator would take into account 11 different rate values. I have created a Rate Master database with the feilds "Rates" "Amount" and "Travel" and populated the feilds.

           I have created a "Rate Calculator" database. This is where the problems begin.........

           I need the calculator to visualy display the following

           "Rates" - This should be a pull down list, that displays the "Rates" from "Rate Master" database

           "Hours" - This should be a user input value.

           "Hourly Total" - This should be a calculation of the "Amount" that corresponds to the "Rates" chosen above * the "Hours" above.

            

           Additionaly

           "Travel Fee" - this should be a radio button or pull down with the choice of "Yes" or "No"

           "Travel Amount" - this should display a $0 if pull down above is chosen "No" or it should pull the "Travel" record from the corresponding "Rates" chosen above from the "Rate Master" database.

            

           "Total" - should be a calculation of the "Hourly Total" + "Travel Amount" 

            

           I have done a simple layout of the "Rate Calculator" ... I have attempted to do the relationships of the database. I have told it to pulls from the corresponding feilds or databases.

           I cannot get it to work.

           Everytime I try to use it, I get  "No records are present. ....." error. If I create a blank record in the calculator (Which I do not need it to make records, I just need it to do simple calculations. I do not want it to record the calculations) then the pulls downs do not work, and it fails to do any calculations.

           Can someone HELP PLEASE??!! What am I missing?? 

           As I said earlier, I am a total newbie, so I know it s probably something simple, but I probably wont understand your explanation of "check the relational links between the databases and put in a if (asdasd::asdasd) command. Please try to make it understandable by a first time Filemaker user. I would even be willing to pay someone to finish the work/links or whatever it takes to get the darn thing to work!!

        • 1. Re: Need Help with Simple Calculator!
          philmodjunk

               Your post implies that you have more than one table here, but you don't identify them nor how they might be linked in relationships.

               

                    "Travel Amount" - this should display a $0 if pull down above is chosen "No" or it should pull the "Travel" record from the corresponding "Rates" chosen above from the "Rate Master" database.

               And how would you determine which record in Rates Master is the "corresponding" record? And what data in that table needs to be "pulled"?

               I think we need to see those tables and how they are related. If this were all in a single table, (except for the table of rates selected from the value list) this becomes very straight forward so can only assume that the relationship structure is what is causing trouble for you.

                

                

          • 2. Re: Need Help with Simple Calculator!
            MacMcAhren

                 Sorry, 

                 Yes I have 2 tables - "Rate Master" (As detailed above) and "Rate Calculator"

                 I thought I described how they were linked.

                 "Rate Master" table has the fields "Rate" (Text Value, basically a description), "Value" (A Currency Number) and "Travel" (Another Currency Number Value) ... there are 11 records in the "Rate Master" Table/Fields

                 "Rate Calculator" table has the following feilds, and relationships:

                 "Rate" - Related to "Rate" on the "Rate Master" table - Should be a pull down menu

                 "Hours" - Blank, needs to be a user input number.

                 "Hourly Total" - needs to be a calculation of the corresponding record of "Value" from the "Rate" on the "Rate Master" - Times(*) the "Hours" entered above.

                 "Travel Fee" - Pull Down or Radio Button with the values of "No" and "Yes"

                 "Travel Amount" - IF "Travel Fee" = No then value should be $0.00 - If "Travel Fee" = Yes then "Travel Amount" should display the "Travel" record value from the corresponding "Rate" record chosen in the above pull down.

                 "Total" - should be a calculation of "Hourly Total" + "Travel Amount" 

                 Should I be using only One (1) Table instead of two?

            • 3. Re: Need Help with Simple Calculator!
              MacMcAhren

                   Additional Pictures

              • 4. Re: Need Help with Simple Calculator!
                MacMcAhren

                     Additional Pictures

                • 5. Re: Need Help with Simple Calculator!
                  MacMcAhren

                       OK I simplified things somewhat .....

                       One table .... all fields on one table

                       Layout only includes the items needed to display on the calculator. - Pull down working for "Rate"

                       2 Problems - 

                       Cannot get sum function to work - When I select Sum for the Hourly Total I get the following:

                       Sum ( field {; field…} )

                       I replace with Sum ( Hourly Total {; Amount + Hours…} ) and I get a error that says "Hourly Total" field cannot be found - As such, I cant get the sums to work for Total either

                       Also "Travel" value does not change based upon what "Rate" is chosen in the drop down

                        

                  • 6. Re: Need Help with Simple Calculator!
                    philmodjunk

                         Go back to your original two table set up. The issue lies in this relationship that I can see in your screen shot:

                         Rates Master::Rate = Rates Calculator::Rate AND
                         Rates Master::Amount = Rates Calculator::Rate

                         This is a relationship that will never match a record in RateMaster to a record in RateCalculator and thus this keeps your calculation from working. Double click the relationhip line between these two table occurrences and remove the link to the Amount field so that they only match by the two Rate fields.

                         Delete the second relationship with Rates Master 2 as it is not needed for this calculation.

                         With that change, this calculation should compute the total:

                    Rates Master::Amount * Hours + If ( Travel Fee = "Yes" ; Rates Master::Travel )

                         Just the portion in blue can be used to define Hourly Total and the portion in Black can be used to define Travel Amount.

                         If you define these calculations as auto-entered calculations, subsequent changes to the Amount and Travel fields in Rates Master will not change the values calculated in Rates Calculator. If you define them as calculation fields, such changes will update the computed values in Rates Calculator automatically. Which option is correct depends on how you will use this information in your database.