9 Replies Latest reply on Nov 25, 2010 5:19 PM by moonyounglee

# how can i calculate automtically between repetition fields?

### Title

how can i calculate automtically between repetition fields?

### Post

hi, everyone.

when i want to calculate between repetition fields?

how can i do?

for example..

field A and field B is repetition field.

field A is number and field B is calculation field.

I want to calculate Field A[2] - field A[1], field A[3] - field A [2], field A[4] - field A[3] and field A [5] - field A[4] on field B.

how can i do it?

• ###### 1. Re: how can i calculate automtically between repetition fields?

Case(
FieldA[Get ( CalculationRepetitionNumber ) + 1 ] ;
FieldA[Get ( CalculationRepetitionNumber ) + 1 ] - FieldA[Get ( CalculationRepetitionNumber ) ]
)

• ###### 2. Re: how can i calculate automtically between repetition fields?

If you need more contol on the result, try something like:

Let([
v = FieldA[Get ( CalculationRepetitionNumber ) ] ;
n = FieldA[Get ( CalculationRepetitionNumber ) + 1 ]
];
Case(
not IsEmpty ( n ) and Get ( CalculationRepetitionNumber ) < 5 ;
n - v
)
)

• ###### 3. Re: how can i calculate automtically between repetition fields?

Sorry raybaudi

I try but it do not work.

only 1st repetiotion work and 2nd, 3rd, 4th repetition is not work.

• ###### 4. Re: how can i calculate automtically between repetition fields?

If Field B is really a "calculation" field ( not a field with auto-enter option ), the calculation above MUST work.

• ###### 5. Re: how can i calculate automtically between repetition fields?

thank raybaudi

it work very well.

I have a one more question.

Following your function, result of Field A[2] -field[1] is in field B[1].

i want to put result in field B[2]. thus changed function many way.

but result is not good.

Is any good method ?

what i want is

field A[2] - field A[1] -> field B[2]

field A [3] - field A[2] -> field B[3]

field A [4] - field A[3] -> field B[4]

...

thank raybaudy again.

• ###### 6. Re: how can i calculate automtically between repetition fields?

try:

Case(
Get ( CalculationRepetitionNumber ) > 1 and not IsEmpty ( FieldA [ Get ( CalculationRepetitionNumber ) ] ) ;
FieldA [ Get ( CalculationRepetitionNumber ) ] - FieldA [ Get ( CalculationRepetitionNumber ) - 1 ]
)

• ###### 7. Re: how can i calculate automtically between repetition fields?

sorry, it do not work.

I write function you noticed.

Case(
Get ( CalculationRepetitionNumber ) > 1 and not IsEmpty ( FieldA [ Get ( CalculationRepetitionNumber ) ] ) ;
FieldA [ Get ( CalculationRepetitionNumber ) ] - FieldA [ Get ( CalculationRepetitionNumber ) - 1 ]
)

FieldA is calculation field from other fields.

when i try, fieldA do not show any result. only empty.

is there any problem?

• ###### 9. Re: how can i calculate automtically between repetition fields?

thank..

i'll try...