Jump to content

Separate calculations for a repeating calc. field?


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

Recommended Posts

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?

Link to comment
Share on other sites

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 ) & "

Link to comment
Share on other sites

  • 1 month later...

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.

Link to comment
Share on other sites

This topic is 7121 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.