sum(a*b) in Trailing Grand Summary

Is there any way to show sum(ab) in a Trailing Grand Summary, without first creating ab as a stored calc, then using it in an aggregate sum? creating stored calcs is clumsy, and very “filemaker”

I tried creating this calc directly as return sum(a*b);
But this calc displays blank

also, what if I need sum(a)/sum(b)? a stored calc of a/b, summed, would not give the correct result

thanks
greg

gdurniak:
Is there any way to show sum(ab) in a Trailing Grand Summary, without first creating ab as a stored calc, then using it in an aggregate sum? creating stored calcs is clumsy, and very “filemaker”

I tried creating this calc directly as return sum(a*b);
But this calc displays blank

also, what if I need sum(a)/sum(b)? a stored calc of a/b, summed, would not give the correct result

thanks
greg

By heart:

Aggregate 1 sum(A)
Aggregate 2 sum(b)
calc field: return Aggregate 1/Aggregate2

Or, of course, you can use a method and SQL. In this case, you’ll need only one field…

sorry. sum(a)/sum(b) was a poor example

my reports have many calculated columns (like sum(a*b)), and I would really like to avoid creating, editing, and managing a bunch of stored calcs

is there a better way?
would the reportwriter module help?
a method and SQL? can you point me to an example?

thanks
greg

gdurniak:
sorry. sum(a)/sum(b) was a poor example

my reports have many calculated columns (like sum(a*b)), and I would really like to avoid creating, editing, and managing a bunch of stored calcs

is there a better way?
would the reportwriter module help?

Yes: it’s an excellent be a source of inspiration…

gdurniak:
a method and SQL? can you point me to an example?

You can put all your calculation in a method: when you run the method, you can populate the number fields with the result (no stored calcs needed).
The next step could be using SQL + HTML to build your report (like reportwriter does).
In this case, what you need is a single, global field and you can use it for ALL your reports (no other fields needed).

Just browse the forum searching SQL and HTML: you’ll find tons of examples :-)

Ciao