Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

  • Newbies
Posted

I can't find an explanation of this prompt so cannot fix the problem. The prompt shows after typing a calculation into a calc field:

"A number, text constant, field name or "(" is expected here."

I can see that "here" refers to the very beginning of the calculation because the first 2 characters get highlighted. The calculation purpose is to create an html web page and begins:

When I click "Storage Options" or "OK" to define the field, the above prompt shows.

The frustrating thing is that I can't find how to fix the problem, or even how to search for an answer. If I simply add one of the prompt suggestions, such as: one of the field names or the symbol: (

a new prompt shows: "The specified field cannot be found."

Any help out there?

Thank you.

Posted

It's just a general message you get when Filemaker doesn't understand your formula.

A formula can contain field names, variables, constants, operators and functions. In your case, the formula begins with a comparison operator < that doesn't have anything on its left side. Since you are trying to enter a text constant, you must enclose it in quotation marks.

See Help > Creating a database > Working with formulas and functions > Identifying text constants and special characters in formulas

Posted

If you're adding text to the calculation, it needs to be enclosed in double quotes (literal text) otherwise FMP's calculation engine assumes it's a field name or a function name.

""

  • Newbies
Posted

Thanks. Got the constants and operators figured out.

One more question:

My intent is to paste the data from a particular text field into the calculation field for each record in the dtb. I thought the way to automate this is to:

- While in the "Specify Calculation" window, select the spot within the formula where the text field data is to be pasted and double click on the correct text field title (in the list of Table field titles near top of window).

- But this only prints the text "field name" in the calculation field. For instance: "FILENAME" instead of "Annie Lennox".

What am I missing?

Thank you.

Posted

When you are defining tables, fields,calculations, relationships, etc., you are not dealing with any specific data. The field in question may have "Annie Lennox" in it, but it could also be empty or there could be another record for "Bruce Springsteen". And that's just today - tomorrow there could be 10,000 records, each with a different name.

A calculation field applies the same FORMULA to each and every record, taking the DATA from the fields in the record. If there are 10,000 records, the calculation field returns 10,000 different results - using a single formula.

  • Newbies
Posted

When you are defining tables, fields,calculations, relationships, etc., you are not dealing with any specific data. The field in question may have "Annie Lennox" in it, but it could also be empty or there could be another record for "Bruce Springsteen". And that's just today - tomorrow there could be 10,000 records, each with a different name.

A calculation field applies the same FORMULA to each and every record, taking the DATA from the fields in the record. If there are 10,000 records, the calculation field returns 10,000 different results - using a single formula.

Yes. But how to design the calculation field to do this??? So far, I can only get the field name such as: "FILENAME" to appear in the calculation field, not the data within the FILENAME field.

Ahhh ..... challenges of logic... how to write exactly what I mean....

OK, maybe this is better: I want the calculation field to perform the same calculation for each record. This is to create something like a mail merge document within the calculation field for each record. So the record that has "Annie Lennox" in the "FILENAME" field should have "Annie Lennox" in a specific selected spot of the text in the calculation field for that one record. Another record may have "Eric Clapton" in the FILENAME field, so I want "Eric Clapton" to be automatically inserted into the same specific selected spot of the text in the calculation field, in that particular record. Each record would have a different 'person' listed in the same spot of the calculation field for 'their' particular record. If there is no data in a field, nothing would go in the calculation field.

This may help, or not. The goal of the calculation field text is to automatically create a bit of html for pages on this website:

http://ArtShowArtists.com

Thank you, for any help.

Posted

Try the following formula =


"Dear " & FILENAME & ",¶How are you?"

Do you see how it works? The text constants are enclosed in quotation marks, while the field reference FILENAME and the & operator are placed directly in the formula.

Note that some characters must be escaped when used in a text constant - see Help > Creating a database > Working with formulas and functions > Identifying text constants and special characters in formulas.

  • 4 weeks later...

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