4 Replies Latest reply on Jan 31, 2014 10:07 AM by jimwolfe

# Problem with Column Totals

### Title

Problem with Column Totals

### Post

I'm a fairly new FM12 user so please bear with me.

I have a very simple table which has two columns containing material costs: Cost1 and Cost2.

At the bottom of this table I display the totals of each of these columns. For example \$400 for Cost1 column and \$600 for Cost2 column.

In an attempt to display total costs I added a third column "Total Cost" and used the formula Cost1+Cost2.

The problem is that every record in my table displays \$1000 and at the end is the grand total of ALL records.

Suggestions greatly appreciated.

Jim

• ###### 1. Re: Problem with Column Totals

What you describe does not "add up" in more ways than one. I think you need to describe your design in more detail.

If cost 1 and Cost 2 are number fields defined in the layout's (or a portal's) table, then Cost1 + Cost2 should compute the sum of those two fields. But what you describe is more typical of incorrectly implemented summary fields in stead of fields of type calculation.

• ###### 2. Re: Problem with Column Totals

Thanks for your response, sorry if I didn't explain things well:

Yes, both Cost1 & Cost2 are number fields. On each of these fields, I set the column to show "Trailing Subtotals". The correct totals do appear at the bottom of their respective columns.

I thought by adding a third field (Grand Total) I would be able to display the sum of Cost1 + Cost2 at the bottom of the new column.

This works but unfortunately the sum (cost1+cost2) appears in every record of the table!

• ###### 3. Re: Problem with Column Totals

sum ( cost1 + Cost 2 ) is not the correct syntax for computing the total of Cost1, Cost2. Is that the exact form of your calculation?

Instead of trying to do this with table view, I would use List view where I can add specific layout parts for totals and subtotals to my layout.Creating Filemaker Pro summary reports--Tutorial