# Repeating Fields Calculations

This topic is 5764 days old. Please don't post here. Open a new topic instead.

## Recommended Posts

• Newbies

hello there,

I'll appreciate any help on this matter.

I have one repeating field with 4 values called "english". english[1], english[2], english[3], english[4].

I have anoter calculated repeating field with 3 values called "diffForEnglish" in which I want to have the following calculated results:

diffForEnglish[1]=english[2]-english[1];

diffForEnglish[2]=english[3]-english[2];

diffForEnglish[3]=english[4]-english[3]

Could anyone tell me how to do this?

Yours,

Claudiu

##### Share on other sites

Try:

```
english[Get ( CalculationRepetitionNumber ) + 1] - english```

##### Share on other sites

• Newbies

Hello there,

The code works just fine.

Thanks again,

Yours,

Claudiu

I have another problem now, hope this will be the last one.

i have same "english" field with 8 repeating values: english[1], to english[8]

and now I want to do an average in the "averageEnglish" field with 4 repeating values as follows:

averageEnglish[1] = Average(english[1];english[2]);

averageEnglish[2] = Average(english[3];english[4]);

averageEnglish[3] = Average(english[5];english[6]);

averageEnglish[4] = Average(english[7];english[8]);

Again many thank's for you time,

Yours,

Claudiu

Edited by Guest
##### Share on other sites

Why are you using Repeating Fields?

Generally speaking, the Repeating Fields were made useless for most things when FileMaker created Relationships.

Perhaps there is a better way to accomplish what you are trying to do, so why not explain what it is that you are trying to accomplish with these Fields?

Lee

##### Share on other sites

• Newbies

Hi Lee,

I work for a scholar situation that have a lot of disciplines "followed" over 8 semesters (4 years of studies).

So for semestrial average i'll have to produce one semesterAverage field with 8 repeating values instead of making 8 separate semesterAverage fields. In my opinion repeating fields saves time.

There are 15 disciplines x 8 semesters, 2 averages x 8 semesters and 2 averages for 4 years. Also differences for each discipline sem2-sem1, sem3-sem2 ... etc.

so only here i save arround 150 calculation fields.

Yours,

Claudiu

I put (for the previous post)

Average( english[Get ( CalculationRepetitionNumber )] ; english[Get ( CalculationRepetitionNumber ) + 1] )

but like this it don't returns in "averageEnglish" the average of [1]sem1-2; [2]sem3-4; [3]sem 5-6 and [4]sem 7-8

Edited by Guest
complete the last post
##### Share on other sites

• Newbies

Hello there,

It seems that this piece of code solve the average problem.

hope this is correct:

Average

( english[Get ( CalculationRepetitionNumber ) + 1] ; english[Get ( CalculationRepetitionNumber ) + 2] )

Many thanks to you all,

P.S. I'll apreaciate a notification is this code is not the right one.

Edited by Guest
##### Share on other sites

This doesn't seem like a good arrangement to have. I believe things could be a lot easier if you put all these grades(?) into a related table, each one in a separate record.

##### Share on other sites

This topic is 5764 days old. Please don't post here. Open a new topic instead.

## Create an account

Register a new account