For some time I have tried to combine two calculations with repeating fields into one calculation, without success.

• I have a FIELD_A (10 repeating fields containing text)

• I want to know in which repeating field occurs the first time a certain TEXT

• I have build a first calculation (with 10 repetitions) CALC_TEMP = Case ( FIELD_A = "TEXT": 1 ); then a second calculation that gives the first occurrence of the TET: FINAL_CALC = RepNumber ( CALC_TEMP ; 1 ; 1 )

Could this be done in one calculation, for instance with the LET function? I believe that someone could suggest a clever solution. Thanks.

Broken out you could use a Let:

The above would return a list of matching repetitions

Better yet, set up a custom function that can do it recursively so you don't have to "hardcode" everything. Probably a bit too complex to explain here, but here is a similar custom function that already exists:

FileMaker Custom Function:FindRepetition ( searchString; repeatingField; start; occurrence; end; partialMatch ; matchCas…

The above custom function in your case would be:

Or, Find the repetition where TEXT matches in FIELD_A, starting at the first repetition, ending at the 10th repetition, Do not allow partial match, do not be case sensitive.