Jump to content

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

Recommended Posts

Posted

Is it possible to define separate calculation formulas for a repeating calculation field? e.g. a+b for rep. 1; a-b for rep 2; a*b for rep. 3 etc.

(I do not envisage using any scripts like SetField.)

csb

ps. If this is not possible what is the usefulness of a repeating calculation field?

Posted

Yes, it's not too difficult. You'll need another repeating field (call it repNum) with as many repetitions as you need calculations. This can be a global if you don't need to store the results. The first repetiton will contain the number 1, the second 2, and so forth. Then your calculation will be Choose( repNum - 1, a + b, a - b, a * b, ... ).

Or you could have repNum as 0, 1, 2, etc. and use Choose( repNum, a + b, a - b, a * b, ... )

The best use for repeating calcs is in calculations that increment or decrement. Instead of making a long hardcoded calc such as

Left( field, 1 ) & "

  • 1 month later...
Posted

Get(CalculationRepetitionNumber) only works for version 7. The repnum field is necessary for earlier versions.

For 7 you can use Get(CalculationRepetitionNumber) - 1 for the test portion of Choose and eliminate the need for the zero result of "", similar to the repnum - 1 test shown above.

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.