April 15, 200817 yr I have two tables [1] a master table containing a numeric summary field that is 'looked up' from a detail numeric summary field in a detail table and [2] a detail table containing several records related to the master table by 'job number'. I also created a temporary portal in the master table using this same relationship to verify that my lookup totals are correct. When I perform the lookup operation in the master table, I get a value from the detail table that represents the summary value of the entire detail table [includes all jobs], while the temporary portal, shows only the records as they relate to the currently active job number in the master table. Is there any reason why these two values would be different, considering they use the same relationship?
April 15, 200817 yr A lookup does not aggregate. It goes to the first related record and gets the value from the specified field IN THAT RECORD ONLY. In your details table, the value of a summary field in each and every record is the summary value for the entire table (since there's no found set in this context). I cannot help wondering why would you choose such a roundabout way, instead of placing the summary field from the child table directly on the parent's layout, or define a calculation field using one of the aggregate functions.
April 17, 200817 yr Author Thanks for the input. I'm not familiar with the aggragate functions, but will certainly get familiar with them right now . . I thought that the summary functions [in the child table] only summarized on a 'found' set. When I perform the lookup on the child summary field, I had previously performed a find to restrict the record set to those records associated with the master record. I did understand that the lookup took the value from the 1st record, but believed it to be from the found set . . . apparantly not. I appreciate your advice.
April 17, 200817 yr I thought that the summary functions [in the child table] only summarized on a 'found' set. As a rule, summary fields (not functions) DO summarize the found set. But there are exceptions. One exception (a relatively recent development) is that a related summary field shows the summary value for the RELATED set. If you place a summary field from the child table on a parent's layout, it will show the summary of each parent's children. I understand you expected a lookup to do the same, but alas a lookup fetches the value as evaluated from the point of view of the source record - not the target. The other exception is that in order to summarize a found set, there needs to be a found set. A lookup is performed directly between tables (or table occurrences), and any found sets (plural) that the source table might have in any window are ignored. It must be so, since it's inconceivable that the same lookup would produce different results in two separate windows, each having a different found set.
Create an account or sign in to comment