Solved

Using FilemakerPro, How do you polulate a field in table B with values from a field in table C.

Posted on 2014-07-25
6
488 Views
Last Modified: 2014-07-25
I have two tables related by ID#. I want to add a field in Table B and populate it with values from a field in Table C based on the ID#. I don't know if Calculate is better or Look-up. I don't expect the existing values in the field in Table B to change but more records will be added.
0
Comment
Question by:maryj152
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 25

Expert Comment

by:Will Loving
ID: 40219929
Hi Mary - In most circumstances I think it's preferable to use the Auto-Enter Calculation option over Lookup. Lookup and Re-Lookup can draw values from a related table but, if remember the ver early version of FileMaker, the Lookup was basically the predecessor of Calculation option and it kept primarily for backwards compatibility and a small number of specific uses.

The Auto-Enter calculation option is more flexible because you can not only specify a single field that you want to auto-enter a value from (which is what Lookup does) but you can also specify conditions, use If statements, include other field values, etc., anything you can do in the calculation dialog. So, for example, you might put in something like this:

If( not isempty( ItemID ) and not isempty( Quantity ) ; Quantity * Price )

This calc will only perform the auto-enter when both ItemID and Quantity have values.

In addition, Auto-Enter Calculation option also includes the ability to have the value be updated automatically if something changes via the "Do not replace existing value of field (if any)" checkbox.

Do not replace existing….
This checkbox is ticked by default, meaning that once the field has a value, the Auto-Enter calc will no longer be applied. If you uncheck it as above, the value in the field will be updated anytime one of the referenced fields in the calculation changes. This is extremely useful for when you need to have an indexable Number or Text field based on a calculation but the calculation itself is not indexable. Using the Auto-Enter option with the checkbox unchecked means that the field will be updated like a calculation field but will be indexed so it will produce quick results or can be used in a relationship.
0
 

Author Comment

by:maryj152
ID: 40219990
so what I would do is
unsorted, from bldg to cat, = IF (bldg::ID# = cat::ID#; cat::oclc = bldg::code;)
0
 
LVL 25

Expert Comment

by:Will Loving
ID: 40220027
If the relationship is based on ID, then all you should need in the calculation is the name of the field in Table C that you want to auto-enter into the local field. I think the IF statement is superfluous; if the relationship is based on ID then if the relationship is valid the field should auto-fill, and if it's not it won't.

One additional tip: avoid using characters like # and other punctuation in field names. It can cause problems in calculations.
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:maryj152
ID: 40220094
How do I fill in about 150,000 records in the Table C after adding the new field?
Thanks for the tip but that was not the field name, just used it to make question shorter.
0
 
LVL 25

Accepted Solution

by:
Will Loving earned 500 total points
ID: 40220137
You can populate a field for a found set or all records by using the Replace command form the "Records" menu.

1. Go to a layout that has the new field on it.
2. To do this on all records, select "Show Al Records" from the Records menu.
3. Click in the new field, and then select "Replace…" from the Records menu.
4. In the Replace dialog, click on the "Specify" button next to "Replace with calculated result:"   and enter the related field or calculation that you wish to use (the same one you set in the Auto-Enter)
5. Click the "Replace" button

Note that there is no "Undo" for the replace function. In this case you're using it on a new field that has no previous value, but if you use it on a field that does have a value, then be sure you have a backup in case your calculation is wrong. If in doubt, just create a test field first.

Replace dialogSpecify calculated result for Replace...
0
 

Author Closing Comment

by:maryj152
ID: 40220166
Thank you. Directions were very clear.
0

Featured Post

Do you have a plan for Continuity?

It's inevitable. People leave organizations creating a gap in your service. That's where Percona comes in.

See how Pepper.com relies on Percona to:
-Manage their database
-Guarantee data safety and protection
-Provide database expertise that is available for any situation

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question