12 Replies Latest reply on Aug 26, 2009 9:00 AM by MarieMinga

    Calculations

    MarieMinga

      Title

      Calculations

      Post

      I am trying to set up a field to calculate overtime pay and include it in the earnings for our payroll file. I made a field called Overtime Pay and I put in the calculation of =(.5*Wage Rate)*Overtime. Unfortunately, when I tried to use it, the field only shows 0 even when there is a value of 28 hours in the Overtime field. I do not understand why it is not calculating the fields, is there another way that I can write the equation? Or can you tell me the exact steps I need to take to make the field calculate: half of the Wage Rate times Overtime?

        • 1. Re: Calculations
          ninja
            

          Howdy MarieMinga,

          Welcome to the forum.

           

          Things to check:

          1. Is the field a "Calculation" field as defined under Manage Database?

          2. If so, did you check the box that says "Do Not Store..."

          3. Are all the fields in question from the same table?

          4. If not, can you put all the fields on the layout and see values for them all (i.e. are your relationships formed correctly)?

           

          Let us know!

          • 2. Re: Calculations
            MarieMinga
               The field is a Calculation, and I just checked the box "Do Not Store...", and all of the fields are from the same table. It still is not working, and I noticed that even when there are no values in the Wage Rate and Overtime fields, there is still a small grey 0 in the Overtime Pay box, and in layout mode the box says Overtime Pay in small grey letters while the other boxes say their names in larger black letters. I dont know if that is significant and has something to do with the calculation not working. Is there anything else I can try?
            • 3. Re: Calculations
              ninja
                

              Howdy MarieMinga,

               

              Interesting with the grey...

               

              Try deleting the field from your layout, copying another field that shows up as "larger black letters", double clicking on it and changing the field to your OT calculation field.  I'm wondering if this isn't a text color issue as opposed to a calculation issue...

              • 4. Re: Calculations
                philmodjunk
                   Can't see how "do not store" is relevant here. Stored or Unstored, a calculation field (as apposed to some number fields with auto-entered calculations), should evaluate and update correctly.
                • 5. Re: Calculations
                  MarieMinga
                     I am trying a different approach to the calculation, because it still is not working. THe text isnt an issue because I found I can change it to make it look the same as everything else.

                  I created a new box the calculates the Overtime Rate (Wage Rate*.5) which works. But the Overtime Pay box which now is supposed to calculate Overtime Rate*Overtime still is not working. It now shows $0.00 even when Overtime shows 40.

                  I deleted the previous Overtime Pay box and created a new copied from an existing working box, but I am still having the same problem as before.

                  Any advice?

                  Marie



                  • 6. Re: Calculations
                    philmodjunk
                      

                    Just checking a key detail:

                     

                    Open Manage | Database | Fields and find your field on the list of fields. One column in this list is called "type". For your field, do you see "Number" or "Calculation" in this type column?

                    • 7. Re: Calculations
                      ninja
                        

                      MarieMinga wrote:
                      The field is a Calculation, and I just checked the box "Do Not Store...", and all of the fields are from the same table.

                      Marie,

                       

                      Could you post the actual calculation you are using...Every detail of the syntax?  Your synopsis of the calculation and the implementation sure looks correct, perhaps it's in the syntax.  You describe a system that should work fine...we're looking for the undotted "i" that is making it go wrong.

                       

                      The calculation should be (assuming your table is called "Table1"):

                       "Table1::WageRate * 0.5 * Table1:: Overtime"  (order is unimportant)

                       

                      Phil, having it be unstored will make it update more frequently...I've had indexed or "Indexed as needed" calculation fields not update so I tend to be particular about that one.  You likely know more about the when's and why's of this than I.

                       

                      Edited to remove smiley...there should be no space between the :: and the O


                      • 8. Re: Calculations
                        comment_1
                          

                        If it's in the same table as the referenced fields, then it should look like this:

                         

                        WageRate * .5 * Overtime

                         


                        Ninja wrote:
                        having it be unstored will make it update more frequently...

                        There is no need for it to update more frequently than a stored field - i.e. when one of the referenced fields is modified.

                         


                        • 9. Re: Calculations
                          MarieMinga
                            

                          I split it into two calculation fields, to hopefully make it easier.

                           

                          Overtime Rate=Wage Rate*.5   This calculation is working correctly

                           

                          Overtime Earnings=Overtime Rate*Overtime  This one is still not working.

                           

                          I modeled to equation after the other equations used in this table to figure earnings and wage rate, etc. All of the other calculations are working correctly except for Overtime Earnings.

                          • 10. Re: Calculations
                            comment_1
                              

                            Well, it's hard to guess. Why don't you change Overtime Earnings to say =

                             

                            100 * Overtime

                             

                            and see what happens?

                            • 11. Re: Calculations
                              etripoli
                                 What type of field is 'Overtime'?  Calculation, text, time, number?
                              • 12. Re: Calculations
                                MarieMinga
                                   Overtime is a number