Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can't summarize this field

Status
Not open for further replies.

lynng

MIS
Sep 26, 2000
5
0
0
US
I am trying to place a sum for this formula field in the group footer, but I keep getting a message telling me this field cannot be summarized? It calculates the number of pieces for a product and then I want to sum it for each day. Any suggestions? Thanks.

if GroupName ({PBATCH_TXT.main_product})= "8318 TR" then round (Sum
(({PBATCH_TXT.quantity}), {PBATCH_TXT.outflow_rate})/.9796/12) else
if GroupName ({PBATCH_TXT.main_product})= "7500 TR" then round (Sum
(({PBATCH_TXT.quantity}), {PBATCH_TXT.outflow_rate})/.9367/12) else
if GroupName ({PBATCH_TXT.main_product})= "7008 TR" then round (Sum
(({PBATCH_TXT.quantity}), {PBATCH_TXT.outflow_rate})/1.0328/13) else
if GroupName ({PBATCH_TXT.main_product})= "7010 TR" then round (Sum
(({PBATCH_TXT.quantity}), {PBATCH_TXT.outflow_rate})/.9046/12) else
if GroupName ({PBATCH_TXT.main_product})= "8317 TR" then round (Sum
(({PBATCH_TXT.quantity}), {PBATCH_TXT.outflow_rate})/.9796/12) else
if GroupName ({PBATCH_TXT.main_product})= "8319 TR" then round (Sum
(({PBATCH_TXT.quantity}), {PBATCH_TXT.outflow_rate})/.9796/12) else
if GroupName ({PBATCH_TXT.main_product})= "8316 TR" then round (Sum
(({PBATCH_TXT.quantity}), {PBATCH_TXT.outflow_rate})/.9796/12) else
if GroupName ({PBATCH_TXT.main_product})= "9103 TR" then round (Sum
(({PBATCH_TXT.quantity}), {PBATCH_TXT.outflow_rate})/.8728/12) else
if GroupName ({PBATCH_TXT.main_product})= "9201 TR" then round (Sum
(({PBATCH_TXT.quantity}), {PBATCH_TXT.outflow_rate})/1.0145/12) else
if GroupName ({PBATCH_TXT.main_product})= "9202 TR" then round (Sum
(({PBATCH_TXT.quantity}), {PBATCH_TXT.outflow_rate})/.8814/12) else
if GroupName ({PBATCH_TXT.main_product})= "9155 TR" then round (Sum
(({PBATCH_TXT.quantity}), {PBATCH_TXT.outflow_rate})/.9376/12) else
if GroupName ({PBATCH_TXT.main_product})= "9250 TR" then round (Sum
(({PBATCH_TXT.quantity}), {PBATCH_TXT.outflow_rate})/.9128/12) else
if GroupName ({PBATCH_TXT.main_product})= "8222 TR" then round (Sum
(({PBATCH_TXT.quantity}), {PBATCH_TXT.outflow_rate})/.8328/10) else 0
[sig][/sig]
 
A formula can't do a summary operation on a field that already contains a summary operation.
You could use a running total (see the FAQ for the three formula technique) but there is a much simpler approach.

First, modify your formula so that it doesn't do the summary by group:

if {PBATCH_TXT.main_product}= "8318 TR" then {PBATCH_TXT.quantity} / .9796/12 else
if {PBATCH_TXT.main_product}= "7500 TR" then {PBATCH_TXT.quantity} / .9367/12 else
if {PBATCH_TXT.main_product}= "7008 TR" then {PBATCH_TXT.quantity} / 1.0328/13 else , etc

Note that it doesn't use the Group Name, but the field itself after the "if".
Note that this isn't dealing with the subtotal, but adjusts every quantity record separately.

Now create a subtotal and a grand total of this field in two other formulas (since you need to round at the end of the group)

If the formula above were named {@AdjQty} the subtotal would be:
Round (Sum({@AdjQty}, {PBATCH_TXT.main_product}))

And the grand total would be:
Round (Sum({@AdjQty}))
[sig]<p>Ken Hamady- href= Reports Training by Ken Hamady</a><br>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top