Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Length of calculation


fofun

Recommended Posts

Is there a limit to how long a calculation formula can be, I have been trying to put together a formula with a large number of fields in a Case or If calculation. For example I want to have about 200 possibilities. I would like to auto enter times for about 200 different bus stops, but I get a message that says "too many separators" Anyone have a clue? :rolleyes:

Link to comment
Share on other sites

The error you are getting is due to the default that FMP puts in when you choose the case function. To my knowledge you don't have a limit. Good programing is the only thing that dictates what a calc should look like. You want to be able to look back and see what you are doing. If you look in the help file at the case function example you will see what the calc should look like. Make sure that the seperators are placed like the example and I think your calc should work. The example below is taken from the help file.

case(Score >= 90, "Excellent", Score > 50, "Satisfactory", "Needs Improvement")

John

Link to comment
Share on other sites

Hi fofun,

Welcome to the Café!

 

If you're trying to return 200 results, then on the face of it, a lookup table of times and bus-stops would likely be more appropriate to your needs. From a theoretical viewpoint, a bus timetable is data, so hard coding it into calculations is mixing structure and content, which is generally best avoided. An alternative such as a look-up table would likely be easier to set up, easier to trouble-shoot and easier to maintain. However that's your call.

 

To answer your question, the maximum length of a calculation formula is 30,000 characters (including spaces and operators) - and an error message will alert you if you try to exceed this.

 

If your calculation includes nested Case( ) or If( ) functions, you should also be aware that there is a maximum number of nests allowed in a single IF or CASE statement. Theoretically this maximum is 168 (an FMI TechInfo article no 101536 at http://www.filemaker.com/ti/101536.html gives more details), but in practice you'll find that 134 is about the limit that will reliably compile and calculate. Similarly, a single Case( ) function will max out at around 134 results.

 

To achieve a single expression which will return a large number of results (eg 200 or more) you would nevertheless be able to use a combination of multi-part case functions and nesting. For instance, you could create a series of Case( ) statements with ten results each, then nest 20 of them to achieve sequential logical tests with 200 possible results. Using this technique you'd be likely to hit the 30,000 character limit before you've exhausted the logical potential.

 

...but I'd still encourage you to look at other options, such as a look-up table in a related file. wink.gif

Link to comment
Share on other sites



×
×
  • Create New...

Important Information

Terms of Use