christianv Posted March 11, 2003 Posted March 11, 2003 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!
LaRetta Posted March 11, 2003 Posted March 11, 2003 Hi Christian 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
christianv Posted March 11, 2003 Author Posted March 11, 2003 Hi LaRetta I'm affraid to say that it's a little more complex than it seems! 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!
LaRetta Posted March 11, 2003 Posted March 11, 2003 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
LiveOak Posted March 11, 2003 Posted March 11, 2003 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now