How to "sum" a calculation in a report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neelsfer
    Contributor
    • Oct 2010
    • 547

    #1

    How to "sum" a calculation in a report

    Is it possible to sum a value from a calculation in a textbox in a report
    I use the following formula and cannot use =Sum([totals]). I ignore negative values with this formules when subtracting
    The Totals textbox code is:
    Code:
    =IIf([issued]-[on_hand]<0,0,[issued]-[on_hand])
    please assist
    Attached Files
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    You can also swap negative values to positive using the Abs() function.
    Abs([issued]-[on_hand])

    What is total? If you want to sum the formula, then why are you summing total and not the formula?
    Sum(Abs([issued]-[on_hand]))

    Comment

    • Oralloy
      Recognized Expert Contributor
      • Jun 2010
      • 988

      #3
      neelsfer,

      Another alternative that you have to the inline-if (Iif) is the maximum value function (Max), as in
      Max([issued]-[on-hand], 0)
      So your summation then becomes
      Sum(Max([issued]-[on-hand], 0))

      Cheers,
      Oralloy
      Last edited by Oralloy; May 22 '13, 04:30 PM. Reason: Left out a couple zeroes.

      Comment

      Working...