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.

Can’t use the GetField function to insert the field’s numerical value into a calculation formula.

Featured Replies

Operating system is Windows XP

Filemaker product is Filemaker 8.5 Advanced

I want to calculate the Retail Price from the Wholesale Price using Markups based on ranges from a set of global number fields.

Let’s say the Wholesale price is $0.25. It is contained in a repeating number field that is calculated from Quantity x Unit Price. The retail price field is also a repeating field with the same number of repetitions.

The Markup percentage for this price would be based on the Global Field “From” and the Global Field “To” both of which are number fields. The field that holds the markup percentage will be called “Markup” it to is Global.

Let’s say that “From” is $0.01 and “To” is $0.50

If I use the formula for “Retail”:P

If (Wholesale => .01 and Wholesale =< .50;Wholesale*2;””)

It calculates just fine.

Unfortunately the list of Froms and Tos and Markups need to be modified from time to time and I do not want to have to edit the calculation field to enter new numbers there.

If I use the formula for “Retail”:

If (Wholesale => GetField(From) and Wholesale =< GetField(To);Wholesale * GetField(Markup);””)

It sets the retail to empty. In other words GetField(From) did not become .01 and GetField(To) did not become .5 etc.

If I create a calculation field (repeating or not) to equal GetField(From) it shows .01 the GetField(To) also works alone.

What am I doing wrong?

GetField() is not needed here. The fields (From and To) can be used directly in a calculation. Since you're using them in a repeating calc, you'd need to use the Extend() function to get each value to apply to each repetition.

BTW: You should look into using a related Line Items table for this rather than using repeating fields.

  • Author

Perfect!

I had used it without the GetField but my first Wholesale price was outside the test range so I kept getting nothing.

The extend function was something I was not even aware of.

Thanks,

EMP

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.