Jump to content
Server Maintenance This Week. ×

FM beginner - calculation fields


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

Recommended Posts

I am new to Filemaker and need some assistance.

This is what I would like to have in my database. I sell classified ads and the minium word count is 20 for $30. I would like to be able to automatically calculate what it would be if someone had an ad that was 25 words.

Help me out with what I have done or with something simplier...THANKS!

I have created a field where I input the word count and then another field that lists the words over 20, then another field that will multiple the words over 20 by $1.50 and then add it to the $30 giving a total for the ad. However, some of the ads are less than 20 words and it creates a negative number. Anyway I can fix this or am I wanting too much?

THANKS for helping!!

Link to comment
Share on other sites

I am a newbie with FM, so...do I post it exactly like you said

1.5 * Max ( 20 ; WordCount ( text ) )

or do I put the field name I have for the word count where you have WordCount? sorry, but thanks for all of your help.

Link to comment
Share on other sites

WordCount ( text )

Paste Comment's calc into your calc box then highlight only the word text (or double-click it). Then (from your dropdown of fields), find your field which holds the entire ad text and double-click it. It will replace text with your true field name as:

WordCount ( yourAdField )

You can then eliminate those excess fields you created (to hold the word count, count over 20 etc.) because this one calc will handle it all.

LaRetta :wink2:

Link to comment
Share on other sites

What LaRetta said - unless counting the words in an ad differs from Filemaker's WordCount() function.

BTW, it's not a good practice to store prices in a calculation formula. If your prices change, your entire history gets messed up. Better make price a number field that looks up the current price when the record is created.

The same logic, to a lesser extent, applies to the minimum words requirement. That too can change. So your calc should really be:

PricePerWord * Max ( MinWords ; WordCount ( text ) )

Edited by Guest
Link to comment
Share on other sites

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