Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Juggernaut

FM beginner - calculation fields

Featured Replies

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!!

How about:

1.5 * Max ( 20 ; WordCount ( text ) )

  • Author

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.

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:

  • Author

Got it! THANKS

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

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.