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.

Featured Replies

  • Newbies

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?

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)

  • Author
  • Newbies

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.

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)

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

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

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.

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.

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.