8 Replies Latest reply on Oct 4, 2017 8:50 PM by Shinichiro Murakami

    Subtracting values from a total without resetting

    Alexander Darvishian

      I have a dataset where I need to subtract numbers from a total without "resetting" every time it reads a new row.

       

      For each Month/Year/Country combination the formula should go:

       

      (Number of Employees)*(160hrs/mo) - ((Visa Type 1 Completion Time)*(Count) + (Visa Type 2 Completion Time)*(Count) + (Visa Type Completion Time)*(Count))

       

      This is equal to:

       

      (Hours Available) - (Hours Required)

       

      What's happening is that it is subtracting (Hours available) by row instead of subtracting from its total value.

       

      Taking Month 1/Year 2000/China for example. The correct calculation should be:

       

      ((# of employees parameter. for this example = 50) * 160) - ((19164 * 1)+( 3291 * 0.5)+(3 * 2)) = 8000 - 20815 = -12815