2 Replies Latest reply on Dec 11, 2008 8:46 PM by mayor

    How to calculate the total of expenses?

    mayor

      Title

      How to calculate the total of expenses?

      Post

      Hello,

       

      I have problem when I try to calculate the total of expenses. I got 2 table as below;

       

      Vot(vot_no, vot_amount)

      expenses(po_no, po_amount, po_cancel, total_expenses)

       

      Let say :

      user1 - po_amount is $200

      user2 - po_amount is $300

       

      I want total_expenses = $500

       

      So, what is the formula that i can use to calculate. I have try to use global variable, but when I try to deduct amount from po_cancel, the amount of total_expenses is still same, unchange.

       

      TQ

       

       

        • 1. Re: How to calculate the total of expenses?
          Orlando
            

          Hi TQ

           

          If you want to see the total of all the found records then you can setup a Summary field that Total your po_amount field, so when creating a field specify the Type: as Summary, and create a second one for po_cancel and then a Calculation that Subtract one from the other.

           

            Sum_amount - Sum_cancel 

           

          If you are looking to show the total for a specific grouping, it will depend on how the two tables are linked and which one you are viewing the data from, but you can use the the Calculation Function Sum ( RELATED TABLE:: po_amout ) to total all the po_amount values in the related records, and again do the same for po_cancel if you want to desplay them seperate or subtract one from the other in the one calculation.

           

             Sum ( RELATED TABLE:: po_amout ) - Sum ( RELATED TABLE:: po_cancel )

           

          I hope this makes sense and helps. 

          • 2. Re: How to calculate the total of expenses?
            mayor
               Thanks, I got it.