Jump to content

Table referencing


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

Recommended Posts

  • Newbies

OK....I am trying to access a two dimensional table that I created in a second FM program that will go look at the conditions and come back with the appropriate field, but I am having a lot of trouble with it going out and getting the specific field. It might be the calculations of it, I am really struggling to get this. For Example (If Total_MM = Fat_bicep and (age >=16 and <=29)), get that field. This is on a PC too. Any help or insight on this that would point me in the right direction would be greatly appreciated.

[ July 08, 2001: Message edited by: bdhooper ]

[ July 10, 2001: Message edited by: bdhooper ]

Link to comment
Share on other sites

I'ts amazingly difficult to come up with a solution to these kind of problems when we only get a vague description of what you are trying to do, and really no idea how you have this set up, rant rant.....

Okay this is a wild assumption but I'm guessing that you have a table with columns across listing ages from 16 to 29 and rows for different values of fat_bicep or total_MM (whatever). You want to pull the entry out of the table that corresponds to a certain fat value and a certain age. If I'm right so far (correct me if I way off) then there are a couple of ways to do it. The first is not to use a two dimensional table at all. You create a record for each value that you want to retrieve, rather than for each row that you currently have. Then, you create a compound key based on the age and Fat_Bicep like this:

cKey = Fat_Bicep & "" & Age

You do likewise in the main file, and then set up a relationship between the two files on this compound key field.

Once you have done this, you can now directly access the values you need in calculations or for display on layouts. Check out your filemaker manual chapter 8 for more info.

The other method lets you keep the 2 dimensional format of your lookup data but is cumbersome to implement and use. Basically, you set up a relationship on the Fat_Bicep field only, but then to get the value from the correct column you will need to use the following ugly calculation:

Case(

Age=16,MyRelationship::MyDataField01,

Age=17,MyRelationship::MyDataField02,

Age=18,MyRelationship::MyDataField03,

Age=19,MyRelationship::MyDataField04,

Age=20,MyRelationship::MyDataField05,

Age=21,MyRelationship::MyDataField06,

Age=22,MyRelationship::MyDataField07,

Age=23,MyRelationship::MyDataField08,

Age=24,MyRelationship::MyDataField09,

Age=25,MyRelationship::MyDataField10,

Age=26,MyRelationship::MyDataField11,

Age=27,MyRelationship::MyDataField12,

Age=28,MyRelationship::MyDataField13,

MyRelationship::MyDataField14,

)

Like I said, my assumptions could be way off here. If so, please provide more specific info about what you are trying to and how you have things set up. Hope this helps.

Link to comment
Share on other sites

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