Jump to content

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

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

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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