Hello everyone,

I am wondering if it's possible to have different calculations for different repetition of a field ? Maybe that can't be done, but here is how I came to think about this.

For the purpose of creating a report, I will use a table with calculation fields, some kind of virtual table. For you to make an image, think about a pay slip where you display numbers for a specific pay as well as totals for up to that pay. Then you should display two amounts per category. To get these numbers, I will have Data_1 and Data_2 which will be filled by two ExecuteSQL() calls. Then field_1 will be GetValue ( Data_1; 1), field_2 will be GetValue ( Data_1; 2), etc.

I could double the number of fields_*n*, but instead I thought of having two repetitions: repetition 1 for this pay, and repetition 2 for up to this pay. This is where I run into the wall: how can I set a different calculation for each of the repetition, for example:

field_1[1] = GetValue( Data_1; 1)

field_1[2] = GetValue( Data_2; 1)

I am looking for a way to do it as calculation fields, but maybe I can achieve this only trough a script - it's worth asking .

Thanks

Gilles Plante

Make list of formulas, and evaluate it like

Let ( [

f = List (

"GetValue( Data_1; 1)" ;

"GetValue( Data_2; 1)"

)

] ;

Evaluate ( GetValue ( f ; Get ( CalculationRepetitionNumber ) ) )

)

If every formulas have same format, you can simplify with listing up different part only.

Simplest form is something like

Evaluate ( "GetValue ( Data_" & Get ( CalculationRepetitionNumber ) & ";1)" )