views:

26

answers:

1

I have a running total and would like to stop it when a condition is matched. Eg: I have STOCK qty 100pcs; qty is accumulated from Purchase Order Receiving transactions as below:

   No.     Qty      Accumulate
   1.      20       20
   2.      30       50
   3.      10       60
   4.      40       100
   5.      20       120 

The running total should stop at no. 4, because it has reached the STOCK qty 100.

How can this be done?

A: 

I'm not sure I understand perfectly what you would like to achieve. The running total cannot "stop". The running total evaluates by the rules set by you at the time you create the running total. If I remember well you have four options.

  1. evaluate for each record
  2. on change of a field
  3. change of a group
  4. formula

If we assume that you wanted to reset the running total after every 100 then you need to evaluate for each record (1).

For reset you have again four options:

  1. never
  2. on change of a field
  3. change of a group
  4. formula

Here you could write a formula (4) to check for the amount and reset every time when the counter reaches 100.

G Berdal