2 Replies Latest reply on Feb 9, 2011 7:24 AM by james.gould

# Running Balance of a repeating field

### Title

Running Balance of a repeating field

### Post

HELP WANTED...

we use a repeating number field which we call "transaction amount"

how do we create a field to display the balance of each entry into the repeating field?

put another way...
looling to create another field which will sum each amount enetered in a repeatinfg field and then display same individually

of course we can sum the total of all entries into the repeating field, but that is NOT what we need

we need the sum or running balance of entry 1 + entry 2 to be calculated individually and displayed separately as a "balance forward"

AND SO ON...  ENTRY 1 + 2 + 3 = BALANCE FORWARD.........

using filemaker 5.5

help needed

• ###### 1. Re: Running Balance of a repeating field

You're most likely much better off to use a related table with a portal instead of repeating fields. Among many other advantages, you can then use a summary field with the running total option to do this.

If you insist on repeating fields you'll need a separate calculation field for each repetition:

Repeating Field     Running total

Rep 1                  Repeating field (specify 1 repetition)

Rep 2                  RT1: GetRepetition ( Repeatingfield ; 1 ) + GetRepetition ( Repeatingfield ; 2 )

Rep 3                  RT2: RT1 + GetRepetition ( Repeatingfield ; 3 )

and so forth

• ###### 2. Re: Running Balance of a repeating field

In FM11 (and I presume any other version with the Sum function), this can be done using a 2nd calculation field.

Number - a repeating number field

RTotal - the running total of numbers (a repeating calculation field with the same number of reps as Number)

1 ) Assuming you already have the Number field you want the running total for, you will need to create RTotal and set it to = 0

Step 1) is required otherwise step two will cause a Field Not Found error, as it is recursive.

2 ) edit the calculation for RTotal entering:

If ( Get ( CalculationRepetitionNumber ) = 1 ;

Number[1] ;

RTotal[ Get ( CalculationRepetitionNumber ) - 1 ] + Number[ Get ( CalculationRepetitionNumber ) ] )

Not sure if this is relevant to 5.5 but will hopefully help anybody else brought here by Google (like me).