3 Replies Latest reply on Feb 26, 2014 12:54 PM by philmodjunk

    Calculation based on results obtained at total time.

    davidwadams

      Title

      Calculation based on results obtained at total time.

      Post

           How is it possible to accomplish the following calculation?

            

           (Total A) minus (Total B) = (Total C)

           If (Total C) is positive, post it in column (c)

           If (Total C) is negative, post it in column (d) 

           To phrase this problem differently, how are calculation performed at 'Total Time'?

           Thank you for your help!

            

           Dave Adams

            

        • 1. Re: Calculation based on results obtained at total time.
          philmodjunk

               That would depend on how Total A and Total B are computed/displayed and whether they represent a grand total or a sub total.

               If Total A and Total B are summary fields and you need Total C to be a grand total not a sub total:

               Total C:

               Let ( T = Total A - Total B ;
                       If ( T > 0 ; T )
                     )

               Total D:

               Let ( T = Total B - Total A ;
                       If ( T > 0 ; T )
                     )

               If your are needing a sub total in a sub summary layout part, you an use Get Summary functions in the part of the expressions that compute a value for T to get sub totals instead of grand totals.

               And in other set ups that do not use summary fields to compute totals, you'll need to first describe those calculations before I can suggest a way to get what you want though the above examples may provide you with the needed clue.

          • 2. Re: Calculation based on results obtained at total time.
            davidwadams

                 Hi Phil,

                 Thank for your help. The sub summary calculations now work. The footer Calculations do not work.  I'll list the code below:

                 D_BalanceDueL1 is the SubSummary amount for each member. It is a Calculated Field.

                 D_BalanceDueL1 = Let ( x = GetSummary ( D_PledgeL1 ; D_NameLastFirst  ) - GetSummary ( D_DuesL1 ; D_NameFirstLast ) ; If ( x > 0 ; x ) )

                 The above line works as expected.

                 D_BalanceDueLR should equal the sum of the of the D_BalanceDueL1 totals. It is defined as a Summary Variable The coding for the variable is:

                 D_BalanceDueLR  = Total of D_BalanceDueL1

                 In other words, I'm trying to add the amounts calculated in the SubSummary variable D_BalanceDueL1 to the Final total D_BalanceDueLR

                 The amounts generated by this coding are incorrect.  I have not been able to determine what the amount I'm getting is/

                 I would appreciate any further suggestions you might have.

                  

                 Thank you,

                  

                 Dave Adams 

                  

            • 3. Re: Calculation based on results obtained at total time.
              philmodjunk

                   For grand total calcs, you would not use GetSummary. You would instead refer directly to the summary fields. The examples shown in my previous post did not use getSummary for that reason, they show how to calculate grand totals.