Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

  • Newbies
Posted

I have many grade fields that all require a calculation to get the subject grade transformed into a number so they can be averaged for the different semesters. The calculation I am using is: Position("FDCBA"; Left(fieldLet1; 1); 1; 1) - 1 + Choose(Position("+-"; Right(fieldLet1; 1); 1; 1); 0; .33; -.33). This works fine but I don't want to duplicate it for each subject. Is there a way to write it once (maybe as a custom function) and use it for all the subject grades?

Posted

Sure, you just define it as a custom function with a name, like ConvertGradeLetter, with a parameter of gradeLetter:

ConvertGradeLetter( gradeLetter ) =

Position("FDCBA"; Left(gradeLetter; 1); 1; 1) - 1 + Choose(Position("+-"; Right(gradeLetter; 1); 1; 1); 0; .33; -.33)

  • Newbies
Posted

What am I missing? Doesn't any calculation that has a reference GradeLetter always need a particular field called GradeLetter? I have many different fields with letter grades.

Posted

So is better ?

/*

ConvertToGradeLetter ( text ) custom function

*/

Position("FDCBA"; Left(text; 1); 1; 1) - 1 + Choose(Position("+-"; Right(text; 1); 1; 1); 0; .33; -.33)

Posted

What am I missing? ... I have many different fields with letter grades.

You should have ONE field, with one calculation - but many (related) records.

Posted

gradeLetter is a parameter to the custom function, when you use the custom function, you pass in the field you want it computed for as the argument - that's how the custom functions let you reuse the calculation in multiple places.

Posted

I just noticed the title of this thread. A calculation with no reference returns a constant (unless it incorporates one of the Get() functions, e.g. current date).

Since your result is a function of input, the input needs to referenced. If you have 20 input fields (letter grades), you will need 20 calculation fields, each referencing its own input field. It doesn't matter if you use a custom function or not. A custom function would merely shorten the formula.

The real problem here is the data structure. You could use a repeating field for the grades, and a repeating calculation field for the translation, but that would be only a partial solution.

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