Page 1 of 2

Totals from separate tables

Posted: Tue Jan 21, 2003 2:41 pm
by rkhill74
I am trying to create a report which totals fields from two separate tables. Totaling on the fields in the MASTER table works fine; I get nothing on the field from the RELATED table.____1. The relationship between the two tables consists of two fields.__2. The Sort/Group level for all of the totals in the same (level 2).__3. The headers all work fine.____Is it possible to do what I am trying to do? Do I need to change the relationship? Do I need to change the Sort/Group parameters? HELP!____I know I can get the information through MS Access by creating an extract on the Master table first, then merging with the Related table. However, this is not a viable solution for running in Production. I just use Access to look at data and validate assumptions.____This is a very hot project. Any help would be greatly appreciated.____Thanks,__Keith Hill

=> RE: Totals from separate tables

Posted: Tue Jan 21, 2003 4:38 pm
by kfleming
Try placing the field you are totaling along with the total itself on a record band in the report. This usually helps to diagnose what is wrong. Make sure you are totaling the desired field and that you have selected an appropriate reset level for the total.____Kathleen__R&R Support

==> RE: Totals from separate tables

Posted: Wed Jan 22, 2003 8:08 am
by rkhill74
What should the appropriate reset level be? The same level as the other totals, or different?____Also, since I am linking the two tables with TWO different indices, the field to select appears twice. Should I be linking the tables on two different indices, or just one?____I know that the field I want is correct since I have done a test changing which table is the master and which is related. When I change Master tables, the field is referenced and totals with no problem.

===> RE: Totals from separate tables

Posted: Wed Jan 22, 2003 8:26 am
by kfleming
Did you try adding the field you want to total to a record band?__Is it displaying correctly?__The reset level depends on when you want the total to start a new count.__Typically a total with a group reset goes on a group footer and a total with a grand reset goes in a summary band since this is when they have read all of the records that contribute to the total.____Kathleen__R&R Support

====> RE: Totals from separate tables

Posted: Wed Jan 22, 2003 9:08 am
by rkhill74
[updated:LAST EDITED ON Jan-22-03 AT 09:44 AM (EST)]1. Did you try adding the field you want to total to a record band? - Yes____2. Is it displaying correctly? No - nothing displays____Here is some more info.____The MSTR and RLTD tabled are linked by two fields: ID and TYPE. The relationship is ONE-->MANY between MSTR and RLTD.____This is a summary report, which should produce totals for several fields, but all at the same level. No grand totals are needed. All of the summary breaks are occurring at the proper place, but I cannot get anything for the field in the MSTR table.____I have defined the relationship as a SCAN to handle the one-->many link. This appears to be the proper method. However, this did not work either.____I know that I can establish the relationship through MS Access easily. I must be doing something fundamentally wrong in R&R. Is this a task that I should be able to do in R&R?____I am also trying to accomplish this by making it a multi-scan report. However, when I try to use the____/Database Relation Group____command as outlined in the manual, nothing happens when I get to Group. Is there something else I need to do before trying to use this? I have already setup the two links from MSTR->RLDT1 and MSTR->RLTD2.____Thanks for your continued assistance.__

=====> RE: Totals from separate tables

Posted: Thu Jan 23, 2003 10:06 am
by rkhill74
Any further suggestions?____Thanks__Keith Hill

======> RE: Totals from separate tables

Posted: Thu Jan 23, 2003 2:16 pm
by kfleming
Are you using the Xbase or the SQL version of R&R?____Multiscan and explicit one to many scan relations are only found in the Xbase version but if you are reporting on an Access table, then it must be SQL. So I am confused...______Kathleen__R&R Support

=======> RE: Totals from separate tables

Posted: Thu Jan 23, 2003 2:32 pm
by rkhill74
I am using the XBASE version. I only mentioned MS Access because I can use that as a tool to look at dBaseIV tables.____Thanks,__Keith

========> RE: Totals from separate tables

Posted: Fri Jan 24, 2003 8:35 am
by kfleming
Then it sounds like the problem is at the relation level since you are not getting any data from the related field.____What is your linking field (is it a DBF field or a calculation) and what is the index key expression of your related file? ______Kathleen__R&R Support

=========> RE: Totals from separate tables

Posted: Fri Jan 24, 2003 9:27 am
by rkhill74
I need to link the MSTR to RLTD by two fields. Here is what I am using: ____MSTR->fld1 to RLTD->fld1 alias for RLTD=AAAAA AND__MSTR->fld2 to RLTD->fld2 alias for RLDT-AAAAA1____The system forces me two use two different aliases for the same table.____The problem seems to be when I try to tell the report the field in RLTD that I want to use. Since there are two links, the field definitions appear twice, once for each ALIAS. I have tried selecting the field I want from each of them in different attempts, but the result is the same.____Is this a situation where I want to use the SCAN fx? If so, as I said previously, it does not allow me to define anything. There must be a preliminary step, but I cannot figure it out from the manual.____Thanks for your help,__Keith Hill