6 Replies Latest reply on May 28, 2013 11:50 AM by IgnacioRojo-Allamand

# sum function having a summary field as part of its argument

### Title

sum function having a summary field as part of its argument

### Post

Hello guys, I've been trying to use a summary field value (located in a different table) as an argument for a sum function, but it doesnt calculate anything. Is there any way to retrieve that value and use it. Thanks.

• ###### 1. Re: sum function having a summary field as part of its argument

Not sure what you mean by using a summary field value in another table as an argument for a sum.normally a sum calculation is used in a table that is the "one" in a one-to-many relationship.

• ###### 2. Re: sum function having a summary field as part of its argument

Using a summary field inside a sum function like that sounds like you are attempting to compute the same sum twice. Either you would refer directly to the related table's summary field or use sum to compute the total by referring directly to the related table's number field that the summary field "totals".

• ###### 3. Re: sum function having a summary field as part of its argument
Thanks for replying guys. It seems that i wasn't clear enough, so im'uploding a simplistic drawing... I want that the field "TOTAL" sums up one  or two summary fields in different tables plus a simple numerical field. For that reason i used the following function,  which didnt work. SUM ( TABLE1::SUMMARY_FIELD1; TABLE3::SUMMARY_FIELD2; NUMBER_FIELD) Thanks
• ###### 4. Re: sum function having a summary field as part of its argument

This has to do with the relationship you have - don't have.  You didn't give any details about your relationships but your total is going to be based on the relationship between table 2 to table 1 and table 2 to table 3.  If you create a relationship between table 2 and table 1 using [x] cartesian and table 2 and table [1] using [x] cartesian. It really doesn't matter which field you use because [x]  will include all records.

• ###### 5. Re: sum function having a summary field as part of its argument

Ditto that and you might test this expression instead of sum once you are certain that you have the correct relationships:

TABLE1::SUMMARY_FIELD1 + TABLE3::SUMMARY_FIELD2 + NUMBER_FIELD

Also, make sure that none of your summary fields is set to compute a running total as that can affect the value returned.

• ###### 6. Re: sum function having a summary field as part of its argument
Thanks guys for replying so quick. I'll try modifying the relationships between the tables and i'll comment you later if it worked.