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.

Different Calculation field for each record

Featured Replies

Hi everyone,

I have a big problem: I need to have a calculation field that would be different for each record of a file...

Ex.: I have a file 'PiecesSpecifications' and a file 'Doors'. In 'PiecesSpecifications' there is a calculation field 'Formula' that count how many pieces we need in a specific door according to its width. But that calculation field must be different for each pieces (ie. each record). For example the calculation of Piece #1 could be (DoorWidth * 3) and for Piece #2 (DoorWidth * 2).

Is it possible?

Thank'a a lot!

Hi Christian smile.gif

I believe that, if the value will change for each Piece #, you will need a numeric field in Pieces, something like Quanity. Does door width come from your related Doors dB? And is your DoorWidth field numeric? If so, your formulae in Pieces would be numeric calculation (unstored) similar to:

Doors::DoorWidth * Quantity

LaRetta

  • Author

Hi LaRetta

I'm affraid to say that it's a little more complex than it seems! frown.gif

I put a simple calculation just for the example, but in fact those formula will include more fields, more operations, and some constants. It won't always be a (numeric field * another)...In some case yes, but in most not!

What I would like to do is to define a specific calculation for each of my pieces...I guess I'm only dreaming!

Your help is appreciated!

Hi Christian,

I believe you can place a calculation within a regular field (possibly a text field (?)). I recall seeing a post on this Forum addressing this specific issue (I think by one of the Moderators here). I suggest you post more information about the calculation, ie, field names, data types and whether they are pulled from Pieces or Doors, and an answer will be found! Don't ever give up!

LaRetta

You can put a calculation within a text field, but it won't execute as a calculation. Internally, calculations are not stored as text within FM.

The only option is to create a single calculation with a structure such as a Case statement and use a field "Type" which identifies which calculation each different piece requires:

Case(

Type = 1, <calculation 1 here>,

Type = 2, <calculation 2 here>,

Type = 3, <calculation 3 here>,

.

.

.

If every new piece is different, you would have to alter the structure of the database for each new piece type. The best case is to discover some calculation which can be altered by the parameters entered to cover any type. Kind of like curve fitting with an Nth order polynomial, all you change is the coefficients.

-bd

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.