Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Can I make a calculation in an entry field?


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

Recommended Posts

Posted

Sometimes in an entry field I would like to have a calculation so I can see how I derived at the entry. (Simular to excel, where you see the total but if you click on the box you see the calculation for the total.)

Posted

Without much doubt - I don't think it is possible in Filemaker. Filemaker calculations are defined as field property and they are the same along the entire database.

Other alternatives are possible. However, clicking on a field and value changing is not possible. UNLESS, you make the field a button and you have a script behind the button to alternate the value of the field to calculation/formula. Backdraw is you would not be able to type something in the field then.

Well, that is just my understanding. If there is a solution to this - I will be very interested to hear it.

Posted

While I can't think of an easy way to do this with FileMaker, if I understand you correctly, you can do some workarounds.

Are you always adding numbers into these fields? Is the calculation always of the form "X + Y +Z" or "A + B" where A, B, X, Y and Z are all actually numbers?

If that is the case, then here's one possible solution. Create a text field called Calculation. This field would take the addition equation in the form of "X + Y + Z".

Create another field called AutoCalcResults which is a calculation field with a number result. Set this to the following (which allows for a maximum of three arguments to sum):

Case(

WordCount( Calculation ) = 1,

TextToNum( Calculation ),

WordCount( Calculation ) = 3,

TextToNum( LeftWords( Calculation, 1 ) ) + TextToNum( RightWords( Calculation, 1 ) ),

WordCount( Calculation ) = 5,

TextToNum( LeftWords( Calculation, 1 ) ) + TextToNum( MiddleWords( Calculation, 3, 1 ) ) + TextToNum( RightWords( Calculation, 1 ) )

)

As you can see, with only addition this isn't too difficult. If there's no calculation involved, just enter the number itself into the Calculation field. If you need to provide for more possible arguments, you can do so. If you need to handle operations other than just addition, it'll get much more complicated, but it's still possible.

Chuck

Posted

try this. Lets assume the field name is "NAME"

Create and script like:

if NAME = ""

go to field "NAME"

else

insert calculated value on "NAME" "NAME+1"

end if

the name+1 thing is the calculation u want to insert. if u dont want the calculation to be made dont click on the field after inserting the value. I hope this helps u

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